:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --bg-sidebar: #f9f9f9;
  --border: #e5e5e6;
  --text: #0d0d0d;
  --text-soft: #6e6e80;
  --text-faint: #8e8ea0;
  --accent: #10a37f;
  --accent-hover: #0e8e6d;
  --danger: #d92d20;
  --warn: #b54708;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

.hidden { display: none !important; }

/* ---------- 로그인 ---------- */
.login-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 120% at 50% 0%, #fff 0%, var(--bg-soft) 100%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
  padding: 8px;
}
.brand-mark {
  width: 56px; height: 56px;
  margin: 0 auto 22px;
  border-radius: 16px;
  background: var(--text);
  color: #fff;
  display: grid; place-items: center;
  font-size: 26px;
}
.login-card h1 { font-size: 28px; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.5px; }
.login-card p { color: var(--text-soft); margin: 0 0 32px; }
.btn-google {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 15px; font-weight: 500;
  transition: background .15s, box-shadow .15s;
}
.btn-google:hover { background: var(--bg-soft); box-shadow: var(--shadow); }
.login-foot { margin-top: 28px; font-size: 12.5px; color: var(--text-faint); line-height: 1.7; }

/* ---------- 레이아웃 ---------- */
.app { display: grid; grid-template-columns: 268px 1fr; height: 100%; }
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 16px 12px;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 16px;
  font-weight: 600; font-size: 16px;
}
.sidebar-brand .dot {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--text); color: #fff; display: grid; place-items: center; font-size: 15px;
}
.nav-btn {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 2px;
  border: none; background: transparent; border-radius: 10px;
  font-size: 14.5px; color: var(--text);
  transition: background .12s;
}
.nav-btn:hover { background: #ededed; }
.nav-btn.active { background: #ececec; font-weight: 500; }
.nav-btn .ic { font-size: 16px; width: 20px; text-align: center; }
.nav-new {
  border: 1px solid var(--border); background: #fff;
  font-weight: 500; margin-bottom: 14px;
}
.nav-new:hover { background: var(--bg-soft); }
.sidebar-spacer { flex: 1; }
.profile {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 12px; border: 1px solid transparent;
}
.profile:hover { background: #ededed; }
.profile img { width: 32px; height: 32px; border-radius: 50%; background: #ddd; }
.profile .who { overflow: hidden; }
.profile .who .nm { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile .who .em { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 메인 ---------- */
.main { overflow-y: auto; }
.main-inner { max-width: 760px; margin: 0 auto; padding: 36px 28px 80px; }
.page-title { font-size: 24px; font-weight: 600; letter-spacing: -0.4px; margin: 0 0 4px; }
.page-sub { color: var(--text-soft); margin: 0 0 28px; }

/* 셋업 배너 */
.banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-soft);
  margin-bottom: 12px;
}
.banner.warn { background: #fffaf0; border-color: #fde9c8; }
.banner .b-ic { font-size: 20px; }
.banner .b-body { flex: 1; }
.banner .b-body .t { font-weight: 500; font-size: 14px; }
.banner .b-body .d { font-size: 13px; color: var(--text-soft); }
.banner .ok-tag { color: var(--accent); font-weight: 500; font-size: 13px; }

/* 카드 */
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px;
}
.card h3 { margin: 0 0 16px; font-size: 16px; font-weight: 600; }

/* 폼 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 6px; font-weight: 500; }
.field input, .field select {
  width: 100%; padding: 10px 12px; font-size: 14.5px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
  font-family: inherit; color: var(--text); outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.field input:focus, .field select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,163,127,.12);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.checkbox input { width: auto; }
.hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; border: none;
  font-size: 14.5px; font-weight: 500; transition: background .12s, opacity .12s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-danger-ghost { background: #fff; border: 1px solid var(--border); color: var(--danger); }
.btn-danger-ghost:hover { background: #fef3f2; }
.btn-full { width: 100%; }

/* 작업 목록 */
.job {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; padding: 16px 18px; margin-bottom: 12px;
}
.job-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.job-route { font-size: 16px; font-weight: 600; }
.job-meta { font-size: 13px; color: var(--text-soft); margin-top: 3px; }
.badge {
  font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
  white-space: nowrap;
}
.badge.pending { background: #f2f4f7; color: #475467; }
.badge.running { background: #eff8ff; color: #175cd3; }
.badge.success { background: #ecfdf3; color: #027a48; }
.badge.failed  { background: #fef3f2; color: #b42318; }
.badge.stopped { background: #f2f4f7; color: #475467; }
.badge.expired { background: #fef0c7; color: #b54708; }
.job-err { font-size: 12.5px; color: var(--warn); margin-top: 8px; }
.job-result { font-size: 12.5px; color: var(--accent); margin-top: 8px; white-space: pre-wrap; }
.job-actions { display: flex; gap: 8px; margin-top: 14px; }

.empty { text-align: center; color: var(--text-faint); padding: 48px 0; }

/* 모달 */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: grid; place-items: center; padding: 20px; z-index: 50;
}
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 460px;
  padding: 26px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal h2 { margin: 0 0 4px; font-size: 19px; }
.modal .sub { color: var(--text-soft); margin: 0 0 20px; font-size: 14px; }
.modal-close { float: right; border: none; background: none; font-size: 22px; color: var(--text-faint); line-height: 1; }

/* 토스트 */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 14px; box-shadow: var(--shadow); z-index: 100; opacity: 0;
  transition: opacity .2s, transform .2s; pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .row, .row-3 { grid-template-columns: 1fr; }
}
