/* 목업 B(docs/mockups/b-admin-panel.html) 토큰 기준 */
:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --border: #dde3ec;
  --text: #1a2233;
  --text-muted: #5b6577;
  --text-faint: #8b93a3;
  --accent: #2f6fed;
  --accent-hover: #2558c4;
  --accent-soft: #e8f0fe;
  --success: #17875d;
  --success-soft: #e4f7ee;
  --warning: #a5680a;
  --warning-soft: #fdf1de;
  --danger: #c8342f;
  --danger-soft: #fbe9e9;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .05), 0 6px 18px rgba(20, 30, 50, .07);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Pretendard, Roboto, "Noto Sans KR", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "Roboto Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10141d;
    --surface: #181e2a;
    --surface-2: #1f2632;
    --border: #2c3547;
    --text: #e7eaf1;
    --text-muted: #a2acc0;
    --text-faint: #6d7890;
    --accent: #6a9bf7;
    --accent-hover: #8bb0f8;
    --accent-soft: #1d2c4a;
    --success: #3fcf94;
    --success-soft: #123829;
    --warning: #e2a53d;
    --warning-soft: #3a2d13;
    --danger: #f2716e;
    --danger-soft: #3c1e1e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 상단바 */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; text-decoration: none; color: inherit; }
.brand .mark {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
}
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  padding: 6px 10px; border-radius: 6px; text-decoration: none;
}
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.nav .linkbtn {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  padding: 6px 10px; border-radius: 6px;
  background: none; border: 0; cursor: pointer;
}
.nav .linkbtn:hover { background: var(--surface-2); }
.lock-icon { width: 34px; height: 34px; color: var(--danger); margin: 0 auto; }

/* 본문 */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.container.narrow { max-width: 420px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
h1 { margin: 0; font-size: 18px; font-weight: 700; }
h2 { margin: 4px 0 0; font-size: 15px; font-weight: 700; }
.lead { margin: -8px 0 0; font-size: 13px; color: var(--text-muted); }
.crumb { font-size: 12.5px; color: var(--text-faint); }
.crumb b { color: var(--text); font-weight: 600; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* 폼 */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.hint { font-size: 12px; color: var(--text-faint); }
.input, select.input {
  min-height: 44px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
}
.input:disabled { background: var(--surface-2); color: var(--text-faint); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-end { justify-content: end; }
@media (max-width: 380px) { .row-2 { grid-template-columns: 1fr; } }

/* 버튼 */
.btn {
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 13px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }

/* 알림 */
.alert {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px; border-radius: var(--radius);
  font-size: 13px; line-height: 1.5;
}
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert code { font-family: var(--font-mono); font-size: 12px; opacity: .9; }

/* 배지 */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  color: var(--text-muted); background: var(--surface-2);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-online { color: var(--success); background: var(--success-soft); }
.pill-offline { color: var(--danger); background: var(--danger-soft); }
.pill-warn { color: var(--warning); background: var(--warning-soft); }

/* 목록 */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2);
  text-decoration: none; color: inherit;
}
.list-item .info { flex: 1; min-width: 0; }
.list-item .name { font-weight: 700; font-size: 14px; }
.list-item .addr { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* 빈 상태 */
.empty { text-align: center; padding: 30px 16px; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty svg { color: var(--text-faint); width: 36px; height: 36px; }
.empty .t { font-weight: 700; color: var(--text); font-size: 14px; }
.empty .d { font-size: 12.5px; max-width: 30ch; }

.font-slot { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--border); }
.font-slot .field { flex: 1 1 260px; }
.font-slot label { display: flex; align-items: center; gap: 8px; }
