:root {
  --bg: #12141a;
  --surface: #1a1d24;
  --surface-hover: #20242d;
  --border: #262a33;
  --text: #e6e9ef;
  --muted: #8b92a3;
  --accent: #5b8def;
  --accent-dim: #35507f;
  --success: #3fbf7f;
  --danger: #e5484d;
  --font-ui: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
}

.shell {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 24px;
  font-weight: 700;
  font-size: 15px;
}

.brand-mark { color: var(--accent); }

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13.5px;
  transition: background 0.12s, color 0.12s;
}

.nav-link:hover { background: var(--surface-hover); color: var(--text); }
.nav-link.active { background: var(--accent-dim); color: #cfe0ff; }

.sidebar-footer {
  margin-top: auto;
  padding: 8px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.dot-live { background: var(--success); box-shadow: 0 0 0 3px rgba(63,191,127,0.15); }
.dot-off { background: var(--muted); }
.dot-fail { background: var(--danger); box-shadow: 0 0 0 3px rgba(229,72,77,0.15); }

/* Content */
.content {
  flex: 1;
  padding: 32px 40px;
  max-width: 1900px;
  height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
}

.subtitle {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 24px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

/* Stat cards */
.stats-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  flex: 1;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 600;
}

.stat-label {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}

/* Filters */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

input[type="text"], input[type="url"], select, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: var(--font-ui);
  font-size: 13.5px;
}

input[type="text"]:focus, input[type="url"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255,255,255,0.02);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-hover); }

td.mono, .mono { font-family: var(--font-mono); color: var(--muted); font-size: 12.5px; }

a.row-link { color: var(--text); text-decoration: none; font-weight: 500; }
a.row-link:hover { color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #0b1220;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-hover); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(229,72,77,0.4);
}
.btn-danger:hover { background: rgba(229,72,77,0.08); }

.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-active { background: rgba(63,191,127,0.15); color: var(--success); }
.badge-inactive { background: rgba(139,146,163,0.15); color: var(--muted); }
.badge-fail { background: rgba(229,72,77,0.15); color: var(--danger); }

a.badge { text-decoration: none; cursor: pointer; }
a.badge:hover { filter: brightness(1.3); }

/* Form */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 28px;
  max-width: 640px;
}

.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}
.form-row input, .form-row textarea { width: 100%; }
.form-row .hint { color: var(--muted); font-size: 11.5px; margin-top: 4px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

fieldset {
  border: none;
  border-top: 1px solid var(--border);
  padding: 16px 0 0;
  margin: 16px 0 0;
}
legend { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; padding: 0 4px 0 0; }

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

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12.5px;
}

.article-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 28px;
  white-space: pre-wrap;
  line-height: 1.7;
}

/* Split view: 목록 + 미리보기 - .content(flex column)의 남은 공간을 정확히 채움 */
.split-view {
  display: flex;
  gap: 16px;
  flex: 1;
  min-height: 0; /* flex 자식이 내용물 크기로 늘어나지 않고 부모 높이에 맞춰지게 함 */
}

.list-pane {
  flex: 1 1 55%;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.preview-pane {
  flex: 1 1 45%;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  height: 100%;
  overflow-y: auto;
}

.preview-pane .article-body {
  border: none;
  padding: 0;
  background: transparent;
}

.preview-header h2 {
  font-size: 17px;
  margin: 0 0 6px;
}

.preview-meta-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin: 16px 0 20px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.preview-meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
}

.keyword-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preview-body-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}

.fixed-table {
  table-layout: fixed;
}

.fixed-table td.truncate,
.fixed-table td.truncate span {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixed-table td {
  overflow: hidden;
}

.article-row {
  cursor: pointer;
}

.article-row.row-active td {
  background: var(--accent-dim);
}
