/* ============================================================
   eubaram-ops — 다크 디자인 시스템
   Discord 계열 팔레트 + 바이올렛 accent (#7c5cff)
   Pretendard (UI) / JetBrains Mono (로그·숫자)
   ============================================================ */

:root {
  /* surfaces */
  --bg-0: #18191c;
  --bg-1: #1e1f22;
  --bg-2: #2b2d31;
  --bg-3: #313338;
  --bg-4: #383a40;
  --card: #313338;
  --card-hi: #383a40;

  /* lines */
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* text */
  --text: #f2f3f5;
  --muted: #b5bac1;
  --dim: #80848e;

  /* accent + status */
  --accent: #7c5cff;
  --accent-hi: #9b85ff;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --accent-line: rgba(124, 92, 255, 0.45);
  --green: #23a55a;
  --green-soft: rgba(35, 165, 90, 0.16);
  --red: #f23f42;
  --red-soft: rgba(242, 63, 66, 0.15);
  --yellow: #f0b232;
  --yellow-soft: rgba(240, 178, 50, 0.16);
  --blue: #5865f2;

  /* type */
  --font-ui: "Pretendard", "Pretendard Variable", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Noto Sans KR", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", "Cascadia Code",
    Menlo, Consolas, monospace;

  /* shape */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --sidebar-w: 248px;
  --topbar-h: 60px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-1);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

button { font-family: inherit; }

::selection { background: var(--accent-soft); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2b2d31; border-radius: 8px; border: 2px solid var(--bg-1); }
::-webkit-scrollbar-thumb:hover { background: #3a3c42; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ============================================================
   App shell (index.html)
   ============================================================ */
body.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ---- sidebar ---- */
.sidebar {
  grid-row: 1 / 3;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 50;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 18px 16px;
}
.brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #5b3fd6);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 92, 255, 0.4);
  flex-shrink: 0;
}
.brand .brand-text { line-height: 1.2; }
.brand .brand-text .t1 { font-weight: 800; font-size: 14px; letter-spacing: -0.2px; }
.brand .brand-text .t2 { font-size: 11px; color: var(--dim); margin-top: 1px; }

.nav { padding: 6px 10px 16px; display: flex; flex-direction: column; gap: 2px; }
.nav .nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--dim);
  padding: 12px 12px 6px;
  font-weight: 700;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
  transition: background 0.13s, color 0.13s;
  border: 1px solid transparent;
}
.nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.nav a:hover { background: var(--bg-3); color: var(--text); }
.nav a.active {
  background: var(--accent-soft);
  color: #fff;
  border-color: var(--accent-line);
}
.nav a.active svg { opacity: 1; color: var(--accent-hi); }
.nav a.danger-nav.active { color: #ffd9d9; }

.sidebar-foot {
  margin-top: auto;
  padding: 14px 18px;
  font-size: 11px;
  color: var(--dim);
  border-top: 1px solid var(--border);
}

/* ---- topbar ---- */
.topbar {
  grid-column: 2;
  grid-row: 1;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
}
.topbar .page-title { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
.topbar .spacer { flex: 1; }

.menu-btn {
  display: none;
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-btn svg { width: 20px; height: 20px; }

.health {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 6px 5px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.user-chip .uname { font-weight: 700; font-size: 13px; }
.user-chip .logout {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.13s, color 0.13s;
}
.user-chip .logout:hover { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.user-chip .logout svg { width: 16px; height: 16px; }

/* ---- main ---- */
.main {
  grid-column: 2;
  grid-row: 2;
  overflow-y: auto;
  padding: 22px 26px 60px;
}
.view-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.view-head h2 { font-size: 19px; font-weight: 800; margin: 0; letter-spacing: -0.4px; }
.view-head .sub { font-size: 13px; color: var(--dim); }
.view-head .spacer { flex: 1; }

/* scrim for mobile drawer */
.scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 40;
  backdrop-filter: blur(1px);
}
.scrim.show { display: block; }

/* ============================================================
   Cards / grid
   ============================================================ */
.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card.pad-lg { padding: 20px; }
.card-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--dim);
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* stat tiles */
.stat {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}
.stat .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--dim);
  font-weight: 700;
}
.stat .value {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 700;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.stat .sub { font-size: 11px; color: var(--muted); margin-top: 2px; font-family: var(--font-mono); }

/* gauge */
.gauge {
  display: block;
  width: 100%;
  height: 6px;
  background: var(--bg-4);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}
.gauge .fill { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.5s; }
.gauge .fill.warn { background: var(--yellow); }
.gauge .fill.danger { background: var(--red); }

/* ============================================================
   Badges / pills / dots
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-4);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge.role-owner { background: var(--accent-soft); color: var(--accent-hi); border-color: var(--accent-line); }
.badge.role-operator { background: rgba(88, 101, 242, 0.16); color: #aab4ff; border-color: rgba(88,101,242,.4); }
.badge.danger { background: var(--red-soft); color: #ff9b9c; border-color: rgba(242,63,66,.4); }
.badge.green { background: var(--green-soft); color: #69d68f; border-color: rgba(35,165,90,.4); }
.badge.munpa { background: var(--accent-soft); color: var(--accent-hi); border-color: var(--accent-line); }
.badge.muted2 { background: var(--bg-3); }

.dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--dim);
  flex-shrink: 0;
  display: inline-block;
}
.dot.on { background: var(--green); box-shadow: 0 0 7px rgba(35,165,90,.7); }
.dot.off { background: var(--red); box-shadow: 0 0 7px rgba(242,63,66,.55); }
.dot.warn { background: var(--yellow); box-shadow: 0 0 7px rgba(240,178,50,.6); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700;
  padding: 4px 11px; border-radius: 999px;
}
.pill.on { background: var(--green-soft); color: #69d68f; border: 1px solid rgba(35,165,90,.4); }
.pill.off { background: var(--red-soft); color: #ff9b9c; border: 1px solid rgba(242,63,66,.4); }

/* role chip with color */
.role-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; max-width: 100%;
}
.role-chip .swatch { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.role-chip .rname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   Buttons / inputs
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-3);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.13s, border-color 0.13s, opacity 0.13s, transform 0.05s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--bg-4); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hi); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { background: #ff5457; }
.btn.danger-soft { background: var(--red-soft); border-color: rgba(242,63,66,.4); color: #ff9b9c; }
.btn.danger-soft:hover { background: rgba(242,63,66,.28); }
.btn.green { background: var(--green-soft); border-color: rgba(35,165,90,.45); color: #69d68f; }
.btn.green:hover { background: rgba(35,165,90,.3); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn.ghost:hover { background: var(--bg-3); color: var(--text); }

.input, .select, textarea.input {
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.13s, box-shadow 0.13s;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2380848e' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; font-weight: 700; color: var(--muted); }
.field .hint { font-size: 11px; color: var(--dim); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* toggle */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle input { display: none; }
.toggle .track {
  width: 40px; height: 22px; border-radius: 999px;
  background: var(--bg-4); border: 1px solid var(--border-strong);
  position: relative; transition: background 0.15s, border-color 0.15s; flex-shrink: 0;
}
.toggle .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #d6d8db; transition: transform 0.16s;
}
.toggle input:checked + .track { background: var(--red); border-color: var(--red); }
.toggle input:checked + .track::after { transform: translateX(18px); background: #fff; }
.toggle.neutral input:checked + .track { background: var(--accent); border-color: var(--accent); }
.toggle .tlabel { font-size: 13px; font-weight: 600; }

/* checkbox */
.cbx {
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-1);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.cbx:checked { background: var(--accent); border-color: var(--accent); }
.cbx:checked::after {
  content: ""; position: absolute; left: 5px; top: 1.5px;
  width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ============================================================
   Tables
   ============================================================ */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.table-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl thead th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--dim);
  font-weight: 700;
  padding: 11px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
table.tbl tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
table.tbl td .id { font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
table.tbl td.num, table.tbl th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.checkcol { width: 38px; text-align: center; }

.member-cell { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-4); flex-shrink: 0; object-fit: cover;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted);
}
.member-cell .mname { font-weight: 600; }
.member-cell .msub { font-size: 11px; color: var(--dim); }

/* ============================================================
   Log viewer
   ============================================================ */
.logbox {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  padding: 12px 14px;
  overflow: auto;
  height: 460px;
  white-space: pre-wrap;
  word-break: break-word;
}
.logbox .ln { display: block; color: #c7ccd1; }
.logbox .ln.err { color: #ff9b9c; }
.logbox .ln.warn { color: #ffd479; }
.logbox .ln.info { color: #8fd6a8; }
.logbox .empty-log { color: var(--dim); font-style: italic; }

/* ============================================================
   Modal
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 620px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.16s ease;
}
.modal.wide { max-width: 760px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-head .mh-title { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
.modal-head .mh-sub { font-size: 12.5px; color: var(--dim); margin-top: 3px; }
.modal-head .mclose {
  margin-left: auto; background: transparent; border: none; color: var(--dim);
  cursor: pointer; font-size: 22px; line-height: 1; padding: 2px 6px; border-radius: 6px;
}
.modal-head .mclose:hover { background: var(--bg-3); color: var(--text); }
.modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 20px; border-top: 1px solid var(--border);
}

.warn-box {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--red-soft); border: 1px solid rgba(242,63,66,.4);
  border-radius: var(--r-sm); padding: 11px 13px; font-size: 12.5px; color: #ffc4c5;
}
.warn-box.amber { background: var(--yellow-soft); border-color: rgba(240,178,50,.4); color: #ffe0a3; }
.warn-box svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.summary-row { display: flex; gap: 10px; flex-wrap: wrap; }
.summary-row .stat { flex: 1; min-width: 120px; text-align: center; }

/* confirm phrase field highlight */
.confirm-field input.match { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.code-inline {
  font-family: var(--font-mono); background: var(--bg-1); border: 1px solid var(--border);
  padding: 1px 7px; border-radius: 5px; color: var(--accent-hi); font-weight: 700;
}

/* ============================================================
   Toasts
   ============================================================ */
.toast-wrap {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 200; max-width: min(380px, 92vw);
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-3); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm); padding: 12px 14px;
  box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 600;
  animation: slidein 0.2s ease;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
.toast.warn { border-left-color: var(--yellow); }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Misc states
   ============================================================ */
.empty {
  text-align: center;
  color: var(--dim);
  padding: 48px 20px;
  font-size: 13.5px;
}
.empty svg { width: 40px; height: 40px; opacity: 0.5; margin-bottom: 10px; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--bg-4); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; gap: 10px; color: var(--dim); padding: 30px; justify-content: center; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; min-width: 160px; }
.section-gap { margin-top: 20px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 14px; font-size: 13px; }

/* guild / role grid cards */
.pick-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.pick-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  padding: 14px; cursor: pointer; transition: border-color 0.13s, background 0.13s, transform 0.06s;
  box-shadow: var(--shadow); text-align: left;
}
.pick-card:hover { border-color: var(--accent-line); background: var(--card-hi); }
.pick-card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.pick-card .pc-name { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.pick-card .pc-sub { font-size: 12px; color: var(--dim); margin-top: 4px; font-family: var(--font-mono); }
.pick-card.munpa-card { border-left: 3px solid var(--accent); }

.command-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.command-card .cc-head { display: flex; align-items: center; gap: 8px; }
.command-card .cc-title { font-weight: 800; font-size: 14.5px; }
.command-card .cc-desc { font-size: 12.5px; color: var(--muted); margin-top: 7px; }
.command-card .cc-params { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.command-card .cc-params .tag {
  font-family: var(--font-mono); font-size: 11px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px; color: var(--muted);
}
.group-title { font-size: 13px; font-weight: 800; color: var(--muted); margin: 22px 0 12px; letter-spacing: -0.2px; }
.group-title:first-child { margin-top: 0; }

/* ============================================================
   Login page (login.html)
   ============================================================ */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
    var(--bg-0);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 32px 28px 26px;
  box-shadow: var(--shadow-lg);
}
.login-card .brand-block { text-align: center; margin-bottom: 24px; }
.login-card .logo {
  width: 54px; height: 54px; border-radius: 15px; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--accent), #5b3fd6);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 20px;
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.45);
}
.login-card h1 { font-size: 19px; font-weight: 800; margin: 0; letter-spacing: -0.4px; }
.login-card .tag { font-size: 12.5px; color: var(--dim); margin-top: 5px; }
.login-form { display: flex; flex-direction: column; gap: 13px; }
.login-form .field > label { font-size: 12px; }
.login-form .btn { width: 100%; padding: 11px; font-size: 14px; margin-top: 4px; }
.login-err {
  display: none;
  align-items: center; gap: 9px;
  background: var(--red-soft); border: 1px solid rgba(242,63,66,.4);
  color: #ffc4c5; border-radius: var(--r-sm); padding: 10px 13px; font-size: 12.5px; font-weight: 600;
}
.login-err.show { display: flex; }
.login-err svg { width: 17px; height: 17px; flex-shrink: 0; }
.login-foot { text-align: center; font-size: 11px; color: var(--dim); margin-top: 18px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  body.app {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
  }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    grid-row: auto;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .topbar { grid-column: 1; grid-row: 1; }
  .main { grid-column: 1; grid-row: 2; padding: 18px 16px 60px; }
  .menu-btn { display: inline-flex; }
  .user-chip .uname { display: none; }
  .health .hlabel { display: none; }
}
@media (max-width: 520px) {
  .summary-row { flex-direction: column; }
  .view-head h2 { font-size: 17px; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
}

/* ============================================================
   모더레이션 확장 (SPEC2 C) — 공통 컴포넌트
   ============================================================ */

/* 서버 선택 pill */
.srv-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.srv-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; color: var(--muted);
  font: inherit; font-weight: 700; font-size: 13px;
  transition: border-color .12s, background .12s, color .12s;
}
.srv-pill:hover { border-color: var(--accent-line); color: var(--text); }
.srv-pill.sel { background: var(--accent-soft); border-color: var(--accent); color: #fff; }
.srv-pill .sp-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.srv-pill .sp-meta { font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.srv-pill.sel .sp-meta { color: #cbbcff; }

/* 뷰 상호 이동 탭 (사이드바가 고정이라 in-page 네비) */
.mod-nav {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px;
}
.mod-tab {
  padding: 7px 13px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 700; color: var(--muted); border: 1px solid transparent;
  transition: background .12s, color .12s;
}
.mod-tab:hover { background: var(--bg-3); color: var(--text); }
.mod-tab.active { background: var(--accent-soft); color: #fff; border-color: var(--accent-line); }

/* 개요 → 관리 도구 바로가기 카드 */
.tool-links { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tool-link {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  padding: 14px 16px; box-shadow: var(--shadow);
  transition: border-color .12s, background .12s, transform .06s;
}
.tool-link:hover { border-color: var(--accent-line); background: var(--card-hi); transform: translateY(-1px); }
.tool-link .tl-name { font-weight: 800; font-size: 14px; }
.tool-link .tl-desc { font-size: 12px; color: var(--dim); }

/* 세그먼트 컨트롤 (탭/프리셋) */
.seg {
  display: inline-flex; gap: 4px;
  background: var(--bg-1); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 3px;
}
.seg.wrap { flex-wrap: wrap; }
.seg-btn {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 12px;
  border-radius: 5px; cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--accent-soft); color: #fff; border-color: var(--accent-line); }

/* 일괄 작업 선택 카드 */
.action-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.action-card {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 12px 14px; cursor: pointer; color: var(--text); font: inherit;
  transition: border-color .12s, background .12s;
}
.action-card:hover { border-color: var(--accent-line); background: var(--bg-3); }
.action-card.danger-soft { border-color: rgba(242, 63, 66, .35); }
.action-card.danger-soft:hover { background: var(--red-soft); }
.action-card .ac-label { font-weight: 800; font-size: 14px; }
.action-card .ac-desc { font-size: 11.5px; color: var(--dim); }

/* 멤버 상세 모달 / 서버 정보 헤더 */
.member-cell.clickable { cursor: pointer; border-radius: 6px; }
.member-cell.clickable:hover .mname { color: var(--accent-hi); text-decoration: underline; }
.md-head, .info-head { display: flex; align-items: center; gap: 14px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.md-id { min-width: 0; }
.md-name { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.md-sub { font-size: 12.5px; color: var(--dim); margin-top: 2px; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }

/* 역할 부여/회수 선택기 */
.role-pick-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 280px; overflow: auto;
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px; background: var(--bg-1);
}
.role-pick-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 8px; border-radius: 5px; }
.role-pick-row:hover { background: var(--bg-3); }
.rp-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; }
.rp-swatch { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.rp-btns { display: flex; gap: 5px; flex-shrink: 0; }
.rp-btn {
  font: inherit; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 5px;
  border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--muted); cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.rp-btn:hover { color: var(--text); }
.rp-btn.add.on { background: var(--green-soft); color: #69d68f; border-color: rgba(35, 165, 90, .5); }
.rp-btn.remove.on { background: var(--red-soft); color: #ff9b9c; border-color: rgba(242, 63, 66, .5); }

/* 감사 로그 타임라인 */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; padding: 4px 0; }
.tl-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  margin-top: 6px; flex-shrink: 0; box-shadow: 0 0 0 3px var(--accent-soft); position: relative;
}
.tl-item:not(:last-child) .tl-dot::after {
  content: ""; position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  width: 2px; height: calc(100% + 14px); background: var(--border);
}
.tl-body { flex: 1; padding-bottom: 12px; min-width: 0; }
.tl-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-time { margin-left: auto; font-size: 11px; }
.tl-reason { font-size: 12.5px; color: var(--muted); margin-top: 4px; word-break: break-word; }

/* 메시지 작성 미리보기 / 임베드 */
.msg-preview {
  background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 12px 14px; font-size: 13.5px; min-height: 44px; word-break: break-word;
}
.embed-prev { border-left: 4px solid var(--accent); background: var(--bg-2); border-radius: 4px; padding: 10px 14px; }
.ep-title { font-weight: 800; font-size: 14px; margin-bottom: 5px; }
.ep-desc { font-size: 13px; color: var(--muted); word-break: break-word; }

/* 채널 관리 행 */
.ch-list { display: flex; flex-direction: column; }
.ch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.ch-row:last-child { border-bottom: none; }
.ch-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ch-name { font-weight: 700; font-size: 13.5px; }
.ch-acts { display: flex; gap: 7px; flex-shrink: 0; }

/* 색상 입력 */
input[type="color"] {
  -webkit-appearance: none; appearance: none;
  width: 42px; height: 38px; padding: 2px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--bg-1); cursor: pointer; flex-shrink: 0;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }

@media (max-width: 520px) {
  .ch-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ch-acts { width: 100%; }
}

/* 일괄강퇴: 서버별 아코디언 */
.bk-server { padding: 0; overflow: hidden; margin-bottom: 12px; }
.bk-server-head { width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px; background: transparent; border: 0; cursor: pointer;
  color: var(--text); font: inherit; text-align: left; }
.bk-server-head:hover { background: var(--card-hi); }
.bk-sh-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.bk-caret { color: var(--muted); font-size: 11px; width: 12px; flex: none; }
.bk-sname { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-sh-meta { color: var(--muted); font-size: 13px; flex: none; }
.bk-server-body { padding: 6px 16px 16px; border-top: 1px solid var(--border); }
.group-sub { font-size: 12px; font-weight: 650; color: var(--muted); margin: 14px 0 8px; letter-spacing: .02em; }
.bk-others { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 6px; }
.bk-others > summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 7px 0; }
.bk-others > summary:hover { color: var(--text); }
.bk-others-in { margin-top: 4px; }
