*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --text: #e2e4ed;
  --muted: #6b7280;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --blue: #3b82f6;
  --gray: #4b5563;
  --accent: #6366f1;
}

body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; font-size: 14px; line-height: 1.5; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── 레이아웃 ── */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 24px; height: 52px; display: flex; align-items: center; gap: 16px; }
.topbar-title { font-size: 16px; font-weight: 600; color: var(--text); }
.topbar-badges { display: flex; gap: 8px; margin-left: auto; }

.page { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* ── 뱃지 ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 9999px; font-size: 12px; font-weight: 500; }
.badge-green  { background: #14532d; color: var(--green); }
.badge-yellow { background: #713f12; color: var(--yellow); }
.badge-red    { background: #7f1d1d; color: var(--red); }
.badge-gray   { background: #1f2937; color: var(--muted); }
.badge-blue   { background: #1e3a5f; color: var(--blue); }

/* ── 상태 점 ── */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green  { background: var(--green); }
.dot-yellow { background: var(--yellow); }
.dot-red    { background: var(--red); box-shadow: 0 0 6px var(--red); }
.dot-gray   { background: var(--gray); }
.dot-blue   { background: var(--blue); }

/* ── 카드 ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-title  { font-size: 14px; font-weight: 600; }
.card-meta   { font-size: 12px; color: var(--muted); }

/* ── 호스트 그리드 ── */
.host-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }

/* ── 자동화 행 ── */
.auto-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.auto-row:last-child { border-bottom: none; }
.auto-name { flex: 1; font-size: 13px; }
.auto-name a { color: var(--text); }
.auto-name a:hover { color: var(--accent); text-decoration: none; }
.auto-schedule { font-size: 11px; color: var(--muted); }
.auto-last    { font-size: 11px; color: var(--muted); min-width: 90px; text-align: right; }
.auto-actions { display: flex; gap: 4px; }

/* ── 버튼 ── */
.btn { display: inline-flex; align-items: center; gap-4px; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 500; border: none; cursor: pointer; transition: opacity .15s; }
.btn:hover { opacity: .8; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-danger  { background: #7f1d1d; color: var(--red); }
.btn-success { background: #14532d; color: var(--green); }
.btn-neutral { background: var(--border); color: var(--text); }
.btn-run     { background: #1e3a5f; color: var(--blue); }

/* ── 상세 페이지 ── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.detail-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.detail-value { font-size: 14px; }

.history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.history-table th { text-align: left; padding: 6px 12px; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border); }
.history-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.history-table tr:last-child td { border-bottom: none; }

/* ── 드래프트 배너 ── */
.draft-banner { background: #713f12; border: 1px solid #92400e; color: #fef3c7; padding: 8px 12px; border-radius: 6px; font-size: 12px; margin-bottom: 12px; }

/* ── 섹션 헤더 ── */
.section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.section-title  { font-size: 16px; font-weight: 600; }

/* ── HTMX 로딩 ── */
.htmx-request .btn { opacity: .5; pointer-events: none; }
