/* =========================================================
   InY Bot 대시보드 — InY 사이트와 같은 다크 톤 · 포인트 색 하나
   ========================================================= */
:root {
  /* ▼ 포인트 색은 이 한 줄만 바꾸면 전체에 적용됩니다 */
  --accent: #ff5a1f;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-ink: #0a0a0b;

  --bg: #0a0a0b;
  --bg-2: #0e0e10;
  --surface: #141416;
  --surface-2: #1a1a1d;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f5f5f4;
  --sub: #9b9ba3;
  --dim: #5f5f67;
  --ok: #3dd68c;
  --bad: #ff6369;

  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --side-w: 264px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--sans); letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased; word-break: keep-all;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--dim); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border: 0; border-radius: 999px; white-space: nowrap;
  font-weight: 600; font-size: 14px; background: transparent;
  transition: transform .2s var(--ease), background .2s, box-shadow .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover:not(:disabled) { box-shadow: 0 8px 28px -8px var(--accent); }
.btn-ghost { box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .05); }
.btn-danger { color: var(--bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 40%, transparent); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.btn-lg { height: 52px; padding: 0 28px; font-size: 16px; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 10px; color: var(--sub); }
.btn-icon:hover { color: var(--bad); background: rgba(255, 255, 255, .05); }

/* ---------- 첫 화면(로그인) ---------- */
.landing { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 64px; width: min(1120px, 100% - 64px); margin-inline: auto; padding: 48px 0; }
.logo { font-weight: 800; font-size: 22px; letter-spacing: -0.06em; }
.logo span { color: var(--accent); }
.logo small { margin-left: 8px; font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--sub); }
.landing h1 { margin: 40px 0 18px; font-size: clamp(34px, 4.6vw, 56px); line-height: 1.12; font-weight: 700; letter-spacing: -0.04em; }
.landing h1 em { font-style: normal; color: var(--accent); }
.landing .lead { color: var(--sub); font-size: 17px; max-width: 30em; }
.landing .cta { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.landing .note { color: var(--dim); font-size: 13px; }
.feature-list { margin: 32px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; color: var(--sub); }
.feature-list li { display: flex; gap: 12px; align-items: center; }
.feature-list .ico { color: var(--accent); }
.mock-stack { display: grid; gap: 14px; padding: 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 40px 120px -40px color-mix(in srgb, var(--accent) 35%, transparent); }
.mock-head { display: flex; align-items: center; gap: 8px; color: var(--sub); font-size: 13px; font-weight: 600; padding-bottom: 12px; border-bottom: 1px solid var(--line); }

/* ---------- 서버 고르기 ---------- */
.topbar { display: flex; align-items: center; gap: 16px; width: min(1120px, 100% - 64px); margin-inline: auto; height: 72px; }
.topbar .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; color: var(--sub); font-size: 14px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); object-fit: cover; }
.picker { width: min(1120px, 100% - 64px); margin: 40px auto 80px; }
.picker h1 { font-size: 32px; letter-spacing: -0.04em; }
.picker .lead { color: var(--sub); margin-top: 8px; }
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 32px; }
.server-card { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: left; transition: border-color .2s, transform .2s var(--ease), background .2s; }
.server-card:hover { border-color: var(--line-2); background: var(--surface-2); transform: translateY(-2px); }
.server-card .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-card .meta { color: var(--sub); font-size: 13px; }
.server-card.invite { border-style: dashed; color: var(--sub); }
.server-card.invite:hover { color: var(--text); }
.guild-icon { width: 48px; height: 48px; flex: none; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; color: var(--sub); object-fit: cover; overflow: hidden; }
.guild-icon.sm { width: 38px; height: 38px; border-radius: 11px; font-size: 13px; }
.empty { margin-top: 32px; padding: 40px 24px; border-radius: 16px; border: 1px dashed var(--line-2); color: var(--sub); text-align: center; }
.empty strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }
.empty .btn { margin-top: 20px; }

/* ---------- 서버 관리 화면 ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; background: var(--bg-2); border-right: 1px solid var(--line); }
.side .logo { padding: 0 8px; }
.guild-switch { display: flex; align-items: center; gap: 12px; width: 100%; margin: 22px 0 18px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: left; transition: border-color .2s; }
.guild-switch:hover { border-color: var(--line-2); }
.guild-switch .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-switch .meta { color: var(--dim); font-size: 12px; }
.guild-switch > div { min-width: 0; }
.nav { display: grid; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 12px; width: 100%; height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--sub); font-weight: 500; text-align: left; transition: background .15s, color .15s; }
.nav button:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.nav button[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent); }
.nav button[aria-current="page"] .ico { color: var(--accent); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); color: var(--sub); font-size: 13px; }
.side-foot .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { border: 0; background: none; padding: 4px 6px; color: var(--dim); font-size: 13px; border-radius: 6px; }
.link-btn:hover { color: var(--text); }

.main { padding: 44px 48px 140px; min-width: 0; }
.main-inner { max-width: 1040px; margin-inline: auto; }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 28px; letter-spacing: -0.04em; }
.page-head p { color: var(--sub); margin-top: 6px; }

.card { padding: 26px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.card-head > div:first-child { flex: 1; min-width: 0; }
.card h2 { font-size: 18px; letter-spacing: -0.03em; }
.card .desc { color: var(--sub); font-size: 14px; margin-top: 4px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 28px; align-items: start; }
.stack { display: grid; gap: 18px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.is-off .dim-when-off { opacity: .45; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.divider { height: 1px; background: var(--line); margin: 24px 0; }

/* ---------- 입력 ---------- */
.field-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--sub); }
.hint { margin-top: 8px; font-size: 13px; color: var(--dim); }
.input, .select, .textarea {
  width: 100%; padding: 0 14px; height: 44px; border-radius: 12px; background: var(--bg-2);
  border: 1px solid var(--line-2); outline: 0; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239b9ba3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; text-overflow: ellipsis; }
.select option, .select optgroup { background: var(--surface-2); color: var(--text); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; border: 0; background: var(--surface-2); color: var(--sub); font-size: 13px; }
button.chip:hover { color: var(--text); background: rgba(255, 255, 255, .1); }
.chip code { font: inherit; color: var(--accent); }
.chip .x { color: var(--dim); font-size: 15px; line-height: 1; }
button.chip:hover .x { color: var(--bad); }

.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--sub); font-size: 13px; font-weight: 600; cursor: pointer; }
.toggle input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.toggle .track { width: 44px; height: 26px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); transition: background .2s; position: relative; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--sub); transition: transform .25s var(--ease), background .2s; }
.toggle input:checked + .track { background: var(--accent); box-shadow: none; }
.toggle input:checked + .track::after { transform: translateX(18px); background: var(--accent-ink); }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 개요 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { padding: 20px 22px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.stat .num { font-size: 30px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.2; }
.stat .label { color: var(--sub); font-size: 13px; }
.status-list { display: grid; }
.status-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 4px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.status-row:first-child { border-top: 0; padding-top: 0; }
.status-row:last-child { padding-bottom: 0; }
.status-row .ico-box { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--surface-2); color: var(--sub); }
.status-row .body { flex: 1; min-width: 0; }
.status-row .title { font-weight: 600; }
.status-row .detail { color: var(--sub); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-row:hover .title { color: var(--accent); }
.pill { flex: none; height: 26px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--dim); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.on { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 24px; }
.cmd { display: flex; flex-direction: column; font-size: 13px; color: var(--sub); }
.cmd code { font: 600 14px var(--sans); color: var(--text); }

/* ---------- 역할 패널 ---------- */
.panel-list { display: grid; gap: 10px; }
.panel-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.panel-item .body { flex: 1; min-width: 0; }
.panel-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-item .detail { color: var(--sub); font-size: 13px; }
.role-rows { display: grid; gap: 8px; }
.role-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 84px 34px; gap: 8px; align-items: center; }
.role-row-head { font-size: 12px; font-weight: 600; color: var(--dim); }
.role-rows + .actions { margin-top: 12px; }

/* ---------- 디스코드 미리보기 ---------- */
.preview { position: sticky; top: 24px; }
.preview-label { font-size: 12px; font-weight: 600; color: var(--dim); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; }
.dc { padding: 16px; border-radius: 14px; background: #313338; color: #dbdee1; font-size: 14px; line-height: 1.45; letter-spacing: 0; word-break: break-word; }
.dc-msg { display: flex; gap: 12px; }
.dc-avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; background: #0a0a0b; display: flex; align-items: center; justify-content: center; white-space: nowrap; font-size: 11px; font-weight: 800; color: #fff; letter-spacing: -0.04em; }
.dc-avatar b { color: var(--accent); }
.dc-body { min-width: 0; flex: 1; }
.dc-name { font-weight: 600; color: #f2f3f5; display: flex; align-items: center; gap: 6px; }
.dc-tag { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: #5865f2; color: #fff; }
.dc-content { margin-top: 2px; }
.dc-embed { margin-top: 6px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px 14px; border-radius: 4px; background: #2b2d31; border-left: 4px solid var(--accent); }
.dc-embed.gray { border-left-color: #5f5f67; }
.dc-embed .author { font-size: 13px; font-weight: 600; color: #f2f3f5; margin-bottom: 6px; }
.dc-embed .title { font-weight: 700; color: #f2f3f5; margin-bottom: 6px; }
.dc-embed .text { white-space: pre-wrap; }
.dc-embed .foot { margin-top: 8px; font-size: 12px; color: #949ba4; }
.dc-thumb { width: 56px; height: 56px; border-radius: 6px; background: #1e1f22; object-fit: cover; }
.dc-mention { padding: 0 2px; border-radius: 3px; background: rgba(88, 101, 242, .3); color: #c9cdfb; font-weight: 500; }
.dc-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dc-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 8px; background: #4e5058; color: #fff; font-size: 14px; font-weight: 500; }
.dc-btn.primary { background: #5865f2; }
.dc-empty { color: #949ba4; font-size: 13px; }

/* ---------- 저장 바 · 알림 ---------- */
.savebar { position: fixed; left: calc(var(--side-w) + 50% - var(--side-w) / 2); bottom: 24px; z-index: 40; transform: translate(-50%, 200%); visibility: hidden; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 22px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: 0 20px 60px -10px rgba(0, 0, 0, .7); transition: transform .35s var(--ease), visibility 0s .35s; white-space: nowrap; }
.savebar.show { transform: translate(-50%, 0); visibility: visible; transition: transform .35s var(--ease); }
.savebar span { color: var(--sub); font-size: 14px; margin-right: 8px; }
#toasts { position: fixed; top: 20px; right: 20px; z-index: 60; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: 0 12px 40px -10px rgba(0, 0, 0, .7); font-size: 14px; animation: toast-in .3s var(--ease); }
.toast.ok { border-left: 3px solid var(--ok); }
.toast.bad { border-left: 3px solid var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 1080px) {
  .split { grid-template-columns: 1fr; }
  .preview { position: static; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .landing { grid-template-columns: 1fr; gap: 40px; width: min(1120px, 100% - 40px); }
  .topbar, .picker { width: min(1120px, 100% - 40px); }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; min-width: 0; padding: 14px 16px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-top { display: flex; align-items: center; gap: 12px; }
  .side-top .logo { flex: 1; white-space: nowrap; }
  .guild-switch { width: auto; min-width: 0; max-width: 60%; margin: 0; padding: 6px 10px 6px 6px; }
  .guild-switch .meta { display: none; }
  .guild-switch .guild-icon { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
  .nav { display: flex; overflow-x: auto; margin: 12px -16px 0; padding: 0 12px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav button { width: auto; flex: none; height: 44px; border-radius: 0; }
  .nav button[aria-current="page"] { background: none; box-shadow: inset 0 -2px 0 var(--accent); }
  .side-foot { display: none; }
  .main { padding: 28px 20px 140px; }
  .savebar { left: 50%; width: calc(100% - 24px); justify-content: flex-end; }
  .savebar span { margin-right: auto; }
  .row-2 { grid-template-columns: 1fr; }
  .role-row { grid-template-columns: minmax(0, 1fr) 34px; }
  .role-row-head { display: none; }
  .role-row .input { grid-column: 1; }
  .role-row .btn-icon { grid-column: 2; grid-row: 1; }
  .card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
