:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --nav: #071831;
  --nav-2: #0b2550;
  --nav-active: #0957e5;
  --text: #101828;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #dfe6f2;
  --line-soft: #edf2f8;
  --blue: #1262f3;
  --blue-2: #eaf2ff;
  --green: #16a34a;
  --green-2: #eaf8ef;
  --amber: #f59e0b;
  --amber-2: #fff6e5;
  --red: #ef4444;
  --red-2: #fff0f0;
  --purple: #6d5dfc;
  --shadow: 0 18px 45px rgba(15, 39, 84, .07);
  --shadow-soft: 0 8px 24px rgba(15, 39, 84, .05);
  font-family: Pretendard, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(18, 98, 243, .08), transparent 28%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 36%, #f4f7fb 100%);
  color: var(--text);
  letter-spacing: 0;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.lock {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lock-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  background: linear-gradient(180deg, #071a36 0%, #061326 100%);
  color: #f8fbff;
  padding: 24px 14px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 10px 28px;
  font-weight: 800;
  line-height: 1.15;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #12b76a;
  color: #fff;
  font-weight: 900;
  box-shadow: inset 0 -10px 20px rgba(0, 0, 0, .08);
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  border: 0;
  width: 100%;
  text-align: left;
  color: #d7e3f7;
  background: transparent;
  padding: 12px 13px;
  border-radius: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav button::before {
  content: attr(data-icon);
  width: 20px;
  text-align: center;
  opacity: .92;
}

.nav button.active,
.nav button:hover {
  background: linear-gradient(135deg, var(--nav-active), #0a43b8);
  color: #fff;
  box-shadow: 0 10px 24px rgba(9, 87, 229, .24);
}

.sidebar-footer {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .05);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e8f0ff;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: #223556;
}

.main {
  min-width: 0;
  padding: 26px 26px 36px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

h1 { font-size: 30px; margin: 0 0 6px; line-height: 1.18; font-weight: 900; }
h2 { font-size: 19px; margin: 0 0 14px; font-weight: 850; }
h3 { font-size: 15px; margin: 0 0 10px; font-weight: 850; }
p { margin: 0; color: var(--muted); line-height: 1.58; }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

.panel {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.panel.flat { box-shadow: none; }
.panel.flush { padding: 0; overflow: hidden; }

.metric {
  min-height: 150px;
  display: grid;
  align-content: space-between;
}

.metric-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric .value {
  margin: 12px 0 4px;
  font-size: 34px;
  font-weight: 900;
}

.metric .delta {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.flow-card {
  padding: 24px;
}

.flow {
  display: grid;
  grid-template-columns: 1fr 72px 1fr 72px 1fr 72px 1fr;
  align-items: center;
  gap: 12px;
}

.flow-step {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.flow-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef5ff;
  color: var(--blue);
  font-size: 22px;
  font-weight: 900;
}

.flow-number {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  margin-right: 6px;
}

.flow-title { font-weight: 900; }
.flow-caption { color: var(--muted); font-size: 12px; margin-top: 3px; }
.flow-arrow { height: 2px; background: linear-gradient(90deg, #98bdff, var(--blue)); position: relative; }
.flow-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--blue);
  border-top: 2px solid var(--blue);
  transform: rotate(45deg);
}

.form-row { display: grid; gap: 10px; margin-bottom: 12px; }
.form-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

label {
  display: block;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

textarea { min-height: 130px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(18, 98, 243, .10);
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #111827;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 850;
}
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 10px 22px rgba(18, 98, 243, .18); }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost-blue { color: var(--blue); border-color: #c8dcff; background: #f7fbff; }
.btn.small { padding: 7px 10px; font-size: 12px; border-radius: 7px; }
.btn.big { padding: 15px 22px; font-size: 16px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
table { width: 100%; border-collapse: collapse; background: #fff; min-width: 860px; }
th, td { padding: 14px 15px; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: 13px; vertical-align: middle; }
th { font-size: 12px; color: #667085; background: #fbfdff; position: sticky; top: 0; font-weight: 900; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfdff; }

.inline-detail {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px 14px;
}
.inline-detail summary { cursor: pointer; font-weight: 900; color: #0f172a; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.badge.GO, .badge.YES, .badge.ACTIVE, .badge.HIT, .badge.PROMOTED { background: var(--green-2); color: #128343; border: 1px solid #bcebd0; }
.badge.REVIEW, .badge.SCANNED, .badge.NAVER_CHECKED, .badge.OPENED { background: var(--blue-2); color: #1454c7; border: 1px solid #c8dcff; }
.badge.HOLD, .badge.QUEUED, .badge.TESTING { background: var(--amber-2); color: #b45309; border: 1px solid #ffd89c; }
.badge.SKIP, .badge.NO, .badge.REJECTED, .badge.DYING, .badge.DEAD { background: var(--red-2); color: #d92d20; border: 1px solid #ffc6c6; }
.badge.GENERATED { background: #f2f4f7; color: #475467; border: 1px solid #e4e7ec; }

.score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--green-2);
  color: var(--green);
  font-weight: 900;
}

.progress {
  height: 8px;
  border-radius: 99px;
  background: #e8eef7;
  overflow: hidden;
}
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #61a5ff); }

.notice {
  border: 1px solid #bcebd0;
  background: var(--green-2);
  color: #166534;
  padding: 11px 13px;
  border-radius: 9px;
  font-size: 13px;
  margin-bottom: 14px;
}
.notice.warn { border-color: #ffd89c; background: var(--amber-2); color: #92400e; }
.notice.error { border-color: #ffc6c6; background: var(--red-2); color: #991b1b; }

.tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.tab {
  padding: 0 0 12px;
  color: var(--muted);
  font-weight: 900;
  border-bottom: 3px solid transparent;
}
.tab.active { color: var(--blue); border-color: var(--blue); }

.spark {
  width: 96px;
  height: 26px;
  display: inline-block;
}

.donut {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0 41deg, var(--amber) 41deg 54deg, var(--red) 54deg 360deg);
  position: relative;
}
.donut::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: #fff;
}

.status-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--green);
}

.decision-hero {
  border-radius: 18px;
  border: 1px solid #bcebd0;
  background: linear-gradient(135deg, #f0fff6, #ffffff);
  padding: 34px;
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 250px;
}
.decision-hero.no { border-color: #ffc6c6; background: linear-gradient(135deg, #fff5f5, #fff); }
.decision-hero.hold { border-color: #ffd89c; background: linear-gradient(135deg, #fff9ed, #fff); }
.decision-mark {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-size: 34px;
  font-weight: 900;
  margin-bottom: 12px;
}
.decision-hero.no .decision-mark { background: var(--red); }
.decision-hero.hold .decision-mark { background: var(--amber); }
.decision-word { font-size: 56px; font-weight: 950; color: var(--green); line-height: 1; }
.decision-hero.no .decision-word { color: var(--red); }
.decision-hero.hold .decision-word { color: var(--amber); }

.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.hidden { display: none !important; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .sidebar-footer { display: none; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two, .grid.three, .grid.four, .grid.five, .form-row.two, .form-row.three, .form-row.four { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow-arrow { height: 24px; width: 2px; margin-left: 26px; }
  .flow-arrow::after { right: -4px; top: 14px; transform: rotate(135deg); }
  .main { padding: 18px; }
}
