/* =====================================================
   하이퍼런처 관리자 — Design System
   ===================================================== */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
  --font-sans: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
  --bg-base:        #0f1117;
  --bg-surface:     #1a1d27;
  --bg-surface-2:   #252836;
  --bg-elevated:    #2d3148;
  --border:         #2d3148;
  --border-strong:  #3a3f5a;

  --text-primary:   #f8fafc;
  --text:           #e2e8f0;
  --text-muted:     #94a3b8;
  --text-faint:     #64748b;
  --text-disabled:  #475569;

  --accent:         #3b82f6;
  --accent-soft:    rgba(59, 130, 246, 0.12);
  --accent-strong:  #60a5fa;
  --success:        #22c55e;
  --success-soft:   rgba(34, 197, 94, 0.12);
  --warning:        #f59e0b;
  --warning-soft:   rgba(245, 158, 11, 0.12);
  --danger:         #ef4444;
  --danger-soft:    rgba(239, 68, 68, 0.12);
  --mod-accent:        #16a34a;
  --mod-accent-strong: #22c55e;
  --mod-accent-soft:   rgba(22, 163, 74, 0.2);

  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;

  --sidebar-w: 248px;
}

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

html, body {
  height: 100%;
  width: 100%;
}

#app-root {
  width: 100%;
  min-height: 100vh;
}

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

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit; }
img { display: block; max-width: 100%; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2d3148; border-radius: 8px; border: 2px solid var(--bg-base); }
::-webkit-scrollbar-thumb:hover { background: #3a3f5a; }

/* =====================================================
   레이아웃: 사이드바 + 우측 컨텐츠
   ===================================================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand { cursor: pointer; border-radius: var(--radius-md); transition: background 0.15s; }
.sidebar-brand:hover { background: var(--bg-surface-2); }
.sidebar-brand img { width: 28px; height: 28px; border-radius: 6px; }
.sidebar-brand .name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.sidebar-brand .name small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px 24px;
}

.nav-section {
  padding: 12px 0 4px;
}
.nav-section + .nav-section {
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.nav-section .nav-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 10px 6px;
}
.nav-section .nav-comment {
  font-size: 11px;
  color: var(--text-disabled);
  padding: 0 10px 6px;
  line-height: 1.4;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 5pt 8px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover {
  background: var(--bg-surface-2);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.nav-item .ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-item.active .ico { opacity: 1; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-faint);
}

/* =====================================================
   우측 메인 영역
   ===================================================== */
.main {
  min-width: 0;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.page {
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
  padding: 28px clamp(16px, 2.5vw, 40px) 96px;
  width: 100%;
  max-width: none;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
/* page 안의 형제 요소 사이 균일한 세로 간격 */
.page > * + * { margin-top: 18px; }
/* card-to-card 의 기존 16px 규칙은 위 18px 로 통일됨 */

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* =====================================================
   카드 / 패널 / 빈 상태
   ===================================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card + .card { margin-top: 18px; }
.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.card-body { color: var(--text); }

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(0,0,0,0.15);
}

/* =====================================================
   필터바 (모든 페이지 공용)
   ===================================================== */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .grow { flex: 1; min-width: 200px; }
.toolbar .search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 480px;
}
.toolbar .search input {
  padding-left: 36px;
}
.toolbar .search::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>") center / contain no-repeat;
  opacity: 0.8;
}

/* =====================================================
   폼 컨트롤
   ===================================================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.input, .select, .textarea {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 12px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  background: #11141d;
}
.textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
.textarea.game-description-input { white-space: pre-wrap; }
.game-description-preview {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 48px;
}

.input::placeholder { color: var(--text-disabled); }

.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 180px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

/* 체크박스/스위치 */
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* =====================================================
   버튼
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}
.btn:hover { background: #2d3148; border-color: var(--border-strong); }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.btn-mod {
  background: var(--mod-accent);
  border-color: var(--mod-accent);
  color: #fff;
}
.btn-mod:hover {
  background: var(--mod-accent-strong);
  border-color: var(--mod-accent-strong);
}

.btn-success { background: var(--success); border-color: var(--success); color: #052e16; }
.btn-success:hover { background: #16a34a; }

.btn-danger {
  background: transparent;
  border-color: rgba(239,68,68,0.4);
  color: #fca5a5;
}
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: #fff; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-surface-2); color: var(--text); }

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

/* =====================================================
   테이블
   ===================================================== */
.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
}
.table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}
.table th, .table td {
  text-align: left;
  padding: 11px 14px;
  font-size: 13px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(0,0,0,0.15);
}
.table tbody tr:hover { background: rgba(255,255,255,0.02); }
.table tbody tr:last-child td { border-bottom: none; }
.table th.num,
.table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.download-sessions-table th.num,
.download-sessions-table td.num {
  width: 6.5rem;
  min-width: 6.5rem;
  white-space: nowrap;
}
.table td .small { font-size: 12px; color: var(--text-faint); }
.table .row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* =====================================================
   배지 / 태그
   ===================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9999px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}
.table .col-type {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}
.badge.success { background: var(--success-soft); color: #86efac; border-color: rgba(34,197,94,0.3); }
.badge.warning { background: var(--warning-soft); color: #fcd34d; border-color: rgba(245,158,11,0.3); }
.badge.danger  { background: var(--danger-soft);  color: #fca5a5; border-color: rgba(239,68,68,0.3); }
.badge.accent  { background: var(--accent-soft);  color: #bfdbfe; border-color: rgba(59, 130, 246, 0.35); }
.badge.muted   { background: rgba(148,163,184,0.1); color: var(--text-muted); border-color: var(--border); }
.badge.modrinth {
  background: rgba(167, 139, 250, 0.18);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.4);
}

/* =====================================================
   통계/대시보드 카드
   ===================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
}
.stat .label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat .value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 6px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat .delta {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 4px;
}
.stat .delta.up { color: #4ade80; }
.stat .delta.down { color: #f87171; }

/* =====================================================
   게임 카드 (요구사항 #9)
   ===================================================== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 14px);
  align-items: stretch;
  width: 100%;
}

/* 게임 관리 목록 — 필터·검색 결과 1건이어도 동일 그리드 비율 유지 */
.games-list-wrap {
  width: 100%;
}
.games-list-wrap .game-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1280px) {
  .games-list-wrap .game-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .games-list-wrap .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .games-list-wrap .game-grid {
    grid-template-columns: 1fr;
  }
}
.game-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.game-card:hover { border-color: var(--border-strong); }
.game-card.clickable { cursor: pointer; transition: transform .08s ease, border-color .12s ease, box-shadow .12s ease; }
.game-card.clickable:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -8px rgba(0,0,0,.45); }
.game-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.game-card .thumb {
  aspect-ratio: 16 / 9;
  background: var(--bg-surface-2);
  background-size: cover;
  background-position: center;
}
.game-card .body { padding: 12px 14px 14px; }
.game-card .title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.game-access-panel .btn-sm {
  font-size: 11px;
}
.game-access-panel .field label {
  font-size: 11px;
  margin-bottom: 4px;
}
.game-access-panel-body {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  width: 100%;
}
.game-access-panel-access,
.game-access-panel-featured {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.game-access-panel-access {
  flex: 1;
}
.game-access-panel-featured {
  flex-shrink: 0;
}
.game-access-panel-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  line-height: 1.2;
  min-height: 14px;
}
.game-access-panel-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: var(--game-access-control-h);
}
.game-access-panel .select {
  flex: 1;
  min-width: 120px;
  min-height: var(--game-access-control-h);
  padding: 7px 10px;
  font-size: 12.5px;
  box-sizing: border-box;
}
.game-access-panel .btn-sm {
  flex-shrink: 0;
  min-height: var(--game-access-control-h);
  padding: 0 12px;
  font-size: 12px;
  box-sizing: border-box;
}
.game-access-panel-divider {
  width: 1px;
  flex-shrink: 0;
  align-self: stretch;
  background: var(--border);
  margin-bottom: 0;
}
.game-access-panel {
  --game-access-control-h: 36px;
  width: 100%;
  box-sizing: border-box;
  padding: 16px;
  margin: 0;
}

.game-setting-panel-body {
  flex-direction: column;
  align-items: stretch;
}

.game-setting-panel .game-access-panel-access {
  width: 100%;
}

.game-setting-panel-hint {
  font-size: 11px;
  line-height: 1.45;
  margin-top: 2px;
}

.image-upload-field .image-upload-preview {
  width: 100%;
  min-height: 140px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  background: var(--bg-surface-2) center/cover no-repeat;
}
.image-upload-field .image-upload-preview.has-image {
  border-style: solid;
}
.image-upload-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 720px) {
  .image-upload-grid {
    grid-template-columns: 1fr;
  }
}
.game-featured-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--game-access-control-h);
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-base);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.game-featured-pill:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text-primary);
}
.game-featured-pill.is-on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.game-featured-pill:disabled {
  opacity: 0.6;
  cursor: wait;
}
.game-featured-pill-icon {
  font-size: 13px;
  line-height: 1;
  opacity: 0.85;
}
.game-featured-pill.is-on .game-featured-pill-icon {
  opacity: 1;
}

/* 게임 상세 모달 — 좌(정보 수정) / 우(액세스 코드 + 사용 유저) */
.modal.large.game-detail-modal {
  max-width: min(1180px, calc(100vw - 48px));
}
.game-detail-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .game-detail-top-row {
    grid-template-columns: 1fr;
  }
}

.game-detail-edit-card,
.game-detail-right-col .card {
  height: auto;
}

.game-detail-right-col {
  display: flex;
  flex-direction: column;
  gap: 12px; /* .game-grid 카드 간격과 동일 */
  min-width: 0;
  width: 100%;
}

.game-detail-right-col > .game-access-panel {
  flex-shrink: 0;
}

/* 전역 .card + .card { margin-top: 18px } 가 flex gap 과 중복되지 않도록 */
.game-detail-right-col > .card + .card {
  margin-top: 0;
}

.game-access-code-card .game-detail-access-actions {
  margin-top: 8px;
}

.game-detail-right-col .game-access-code-card {
  flex-shrink: 0;
}

.game-access-code-card-head {
  align-items: center;
  margin-bottom: 14px;
}

.game-access-code-card-body {
  padding-top: 2px;
}

.game-access-code-card-hint {
  font-size: 12px;
  margin: 0 0 10px;
  color: var(--text-faint);
}

.game-access-code-active-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-access-code-active-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.game-access-code-active-main {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  flex: 1;
}

.game-access-code-active-main > .badge {
  flex-shrink: 0;
  max-width: 7.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-access-code-active-meta {
  font-size: 12px;
  line-height: 1.45;
  min-width: 0;
}

.game-access-codes-modal-body .table-wrap {
  max-height: min(60vh, 480px);
  overflow: auto;
}

/* 액세스 코드 상세 — 코드 정보 */
.access-code-detail-info {
  padding: 16px 20px;
}
.access-code-detail-head {
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.access-code-detail-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}
.access-code-detail-head-main .card-title {
  margin: 0;
  flex-shrink: 0;
}
.access-code-detail-head-main .badge {
  font-size: 14px;
  padding: 8px 14px;
  letter-spacing: 0.06em;
}
.access-code-detail-copy-hint {
  font-size: 11.5px;
}
.access-code-detail-fields {
  margin-top: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 24px;
}
.access-code-detail-fields .field label {
  font-size: 11.5px;
  margin-bottom: 6px;
}
.access-code-list-code-cell,
.access-code-head-code-group {
  display: grid;
  grid-template-columns: 7.25rem auto;
  column-gap: 8px;
  align-items: center;
}

.access-code-list-code-cell > .badge:first-child,
.access-code-head-code-group > .badge:first-child {
  justify-self: start;
  max-width: 7.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-code-list-code-cell > .badge:last-child,
.access-code-head-code-group > .badge:last-child {
  justify-self: start;
}

.access-code-detail-fields .access-code-status-select {
  max-width: 100%;
}

.access-code-detail-fields .field > div:last-child {
  font-size: 14px;
}
@media (max-width: 960px) {
  .access-code-detail-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .access-code-detail-fields {
    grid-template-columns: 1fr;
  }
}

.access-code-users-card .toolbar {
  margin-bottom: 12px;
}

/* 사용자 상세 */
.user-detail-head {
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.user-detail-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}

.user-detail-head-main .card-title {
  margin: 0;
}

.user-detail-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 24px;
}

.page.page--user-detail {
  display: block;
}

.page.page--user-detail > .page-header,
.page.page--user-detail > .user-detail-back {
  flex-shrink: 0;
}

.user-detail-back {
  margin-bottom: 12px;
  align-self: flex-start;
}

.user-detail-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
  overflow: visible;
}

.user-detail-section-head {
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.user-detail-section-head .card-title {
  margin: 0;
}

.user-detail-section-desc {
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.45;
}

.user-detail-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}

.user-detail-game-tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-surface-2);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.user-detail-game-tile:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.user-detail-game-tile--admin {
  opacity: 0.92;
}

.user-detail-game-thumb {
  min-height: 72px;
}

.user-detail-game-body {
  padding: 10px;
  min-width: 0;
}

.user-detail-game-title {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.user-detail-login-wrap {
  max-height: min(52vh, 520px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.user-detail-login-table-wrap {
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.user-detail-summary {
  padding: 16px;
}

.user-detail-summary-top {
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 0;
}

.user-detail-summary-identity {
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.user-detail-summary-avatar {
  flex-shrink: 0;
}

.user-detail-summary-uuid {
  font-size: 12px;
  margin-top: 6px;
  word-break: break-all;
}

.user-detail-summary-stats {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.user-role-readonly {
  padding: 14px;
  margin-bottom: 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.user-detail-login-table th {
  white-space: nowrap;
}

.user-detail-login-when {
  min-width: 168px;
}

.user-detail-login-ip {
  white-space: nowrap;
}

.user-detail-login-reason {
  max-width: 200px;
  word-break: break-word;
}

.user-detail-login-os {
  max-width: 160px;
  word-break: break-word;
}

.user-detail-login-footer {
  margin-top: 12px;
}

@media (max-width: 960px) {
  .user-detail-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .user-detail-fields {
    grid-template-columns: 1fr;
  }

  .user-detail-games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 사용자 미리 등록 / 권한 모달 */
.user-reg-modal {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.user-reg-section-hint {
  font-size: 12.5px;
  line-height: 1.5;
}

.user-reg-section-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.user-reg-section {
  display: flex;
  flex-direction: column;
}

.user-reg-lookup {
  padding: 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.user-reg-lookup-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 8px;
}

.user-reg-nickname-input {
  flex: 1;
  min-width: 0;
}

.user-reg-lookup-hint {
  font-size: 11.5px;
  min-height: 16px;
  margin-bottom: 10px;
}

.user-reg-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.user-reg-profile.is-hidden {
  display: none;
}

.user-reg-profile-visual {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.user-reg-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  image-rendering: pixelated;
  background: var(--bg-surface-3);
}

.user-reg-profile-body {
  height: 96px;
  width: auto;
  image-rendering: pixelated;
}

.user-reg-profile-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.user-reg-profile-uuid {
  font-size: 12px;
  margin-top: 4px;
  word-break: break-all;
}

.user-reg-role-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.user-reg-role-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.user-reg-role-opt:hover {
  border-color: var(--accent-muted, var(--accent));
}

.user-reg-role-opt.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-surface-2));
  box-shadow: 0 0 0 1px var(--accent);
}

.user-reg-role-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.user-reg-role-desc {
  font-size: 11.5px;
  line-height: 1.4;
}

.user-reg-games-head {
  align-items: center;
  margin-bottom: 6px;
}

.user-reg-games-count {
  font-size: 12px;
}

.user-reg-games-scroll {
  max-height: min(42vh, 360px);
  overflow: auto;
  padding: 2px;
}

.user-reg-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.user-reg-game-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-surface-2);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
  text-align: left;
}

.user-reg-game-tile:hover {
  border-color: var(--accent-muted, var(--accent));
  transform: translateY(-1px);
}

.user-reg-game-tile.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.user-reg-game-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 80px;
  background: var(--bg-surface-3);
  overflow: hidden;
  flex-shrink: 0;
}

.user-reg-game-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  vertical-align: middle;
}

.user-reg-game-thumb.is-empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, var(--bg-surface-2), var(--bg-surface-3));
}

.user-reg-game-thumb.is-empty::after {
  content: "🎮";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  line-height: 1;
  opacity: 0.45;
  pointer-events: none;
}

.user-reg-game-body {
  padding: 8px;
  min-width: 0;
}

.user-reg-game-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.user-reg-game-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.15s, transform 0.15s;
}

.user-reg-game-tile.is-selected .user-reg-game-check {
  opacity: 1;
  transform: scale(1);
}

.user-reg-game-tile.is-filtered-out {
  display: none;
}

.user-reg-games-tools {
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.user-reg-games-search {
  flex: 1;
  min-width: 160px;
  max-width: 320px;
}

.user-reg-games-bulk {
  gap: 6px;
  flex-shrink: 0;
}

.user-reg-games-filter-empty {
  margin-top: 12px;
}

.user-reg-games-filter-empty.is-hidden {
  display: none;
}

/* 게임 권한 편집 모달 */
.modal.user-perm-dialog {
  max-width: 720px;
}

.modal.user-perm-dialog .modal-body {
  padding-top: 4px;
}

.user-perm-modal {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.user-perm-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin: 0;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
}

.user-perm-avatar-wrap {
  flex-shrink: 0;
}

.user-perm-avatar {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  image-rendering: pixelated;
  background: var(--bg-surface-3);
  display: block;
}

.user-perm-avatar-fallback {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-surface-3);
  border: 1px solid var(--border);
}

.user-perm-info {
  min-width: 0;
  flex: 1;
}

.user-perm-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.user-perm-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.user-perm-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.user-perm-uuid {
  font-size: 12px;
  word-break: break-all;
  margin-bottom: 6px;
}

.user-perm-hint {
  font-size: 12px;
  line-height: 1.45;
}

.user-perm-modal .user-reg-games-scroll {
  max-height: min(48vh, 400px);
}

.user-perm-modal .user-reg-games-grid {
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 12px;
}

.user-perm-modal .user-reg-game-thumb {
  min-height: 96px;
  aspect-ratio: 16 / 10;
}

.user-perm-modal .user-reg-game-body {
  padding: 10px;
}

.user-perm-modal .user-reg-game-title {
  font-size: 13px;
  -webkit-line-clamp: 3;
}

@media (max-width: 520px) {
  .user-reg-role-picker {
    grid-template-columns: 1fr;
  }

  .user-reg-lookup-row {
    flex-direction: column;
  }

  .user-reg-profile {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-reg-games-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .user-reg-games-search {
    max-width: none;
  }

  .user-reg-games-bulk {
    justify-content: flex-end;
  }

  .user-perm-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.access-code-users-pager {
  flex-wrap: wrap;
  gap: 8px;
}

.game-detail-side-card {
  flex-shrink: 0;
}

.game-detail-top-row > .card,
.game-detail-right-col > .card {
  padding: 16px;
}

.game-detail-top-row .card-title,
.game-detail-right-col .card-title {
  margin: 0 0 12px;
  line-height: 1.25;
}

.game-card .meta {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.game-card .footer-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.game-card .footer-row > .badge {
  min-width: 0;
  max-width: calc(100% - 72px);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 파일 관리 — 상단(게임·툴바) 고정, 목록만 내부 스크롤 */
.page.page--installers {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 28px;
}

.page.page--installers > .page-header {
  flex-shrink: 0;
  margin-bottom: 16px;
}

.installers-page {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.installers-page .installers-game-picker,
.installers-page .installers-toolbar-host {
  flex-shrink: 0;
}

.installers-page .installers-toolbar-host .toolbar {
  flex-wrap: nowrap;
  margin-bottom: 0;
  width: 100%;
}

.installers-page .installers-toolbar-host .toolbar .search {
  flex: 1 1 220px;
  min-width: 160px;
  max-width: 420px;
}

.installers-page .installers-toolbar-host .toolbar .select {
  flex-shrink: 0;
}

.installers-page .installers-toolbar-host .toolbar .spacer {
  flex: 1 1 12px;
  min-width: 8px;
}

.installers-page .installers-toolbar-host .toolbar .btn,
.installers-page .installers-toolbar-host .toolbar .text-faint {
  flex-shrink: 0;
  white-space: nowrap;
}

.installers-page .installers-list-host {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  margin-top: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.installers-page .installers-list-host > .table-wrap,
.installers-page .installers-list-host > .empty,
.installers-page .installers-list-host > .row,
.installers-page .installers-list-host > .mc-file-explorer {
  flex: 1 1 auto;
  min-height: 0;
}

.installers-page .installers-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

.installers-page .installers-table-wrap th.col-update-sync {
  min-width: 6.75rem;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
  line-height: 1.3;
}

.installers-page .installers-table-wrap td.col-update-sync {
  width: 92px;
  min-width: 92px;
  text-align: center;
  vertical-align: middle;
}

.installers-page .installers-table-wrap .sync-status-badge {
  display: inline-flex;
  justify-content: center;
  min-width: 52px;
}

.installers-page .installers-table-wrap .col-installer-actions {
  min-width: 300px;
  vertical-align: middle;
}

.installers-page .installers-table-wrap .installer-row-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 6px;
}

/* 설치 폴더 그룹 — 들여쓰기·배경만 (파란 테두리 없음) */
.installers-page .installers-table-wrap .installer-folder-group + .installer-folder-group,
.installers-page .installers-table-wrap .installer-folder-group + .installer-plain-rows,
.installers-page .installers-table-wrap .installer-plain-rows + .installer-folder-group {
  border-top: 8px solid transparent;
}
.installers-page .installers-table-wrap .installer-folder-group.is-expanded tr.installer-folder-row td {
  background: rgba(255, 255, 255, 0.04);
}
.installers-page .installers-table-wrap tr.installer-folder-child td {
  background: rgba(255, 255, 255, 0.02);
  border-top: none;
  box-shadow: none;
}
.installers-page .installers-table-wrap tr.installer-folder-child td:first-child {
  padding-left: 16px;
}
.installers-page .installers-table-wrap .installer-folder-child-label {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.06);
  border: none;
}
/* 폴더 헤더(▶ Modrinth 모드 / 경로) 텍스트 시작 위치와 자식 행 정렬 */
.installers-page .installers-table-wrap .installer-folder-child-name {
  padding-left: 48px;
}
.installers-page .installers-table-wrap .installer-folder-child-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.installers-page .installers-table-wrap .installer-folder-child-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.installers-page .installers-table-wrap .installer-folder-child-filename {
  font-weight: 600;
  color: var(--text-primary);
}
.installers-page .installers-table-wrap .installer-folder-child-game {
  color: var(--text-faint);
}
.installers-page .installers-table-wrap .installer-folder-tree-mark {
  flex-shrink: 0;
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.35;
  min-width: 1.1em;
  padding-right: 2px;
}
.installers-page .installers-table-wrap .installer-folder-toggle {
  min-width: 28px;
  padding: 2px 6px;
  font-size: 11px;
}
.installers-page .installers-table-wrap .btn-sync-toggle {
  min-width: 5.25rem;
  text-align: center;
}

/* ALL(전체 게임) 목록 — 게임 열 강조 */
.installers-page--all .installers-table-wrap th.col-game,
.installers-page--all .installers-table-wrap td.col-game {
  width: 148px;
  min-width: 120px;
  max-width: 200px;
  vertical-align: middle;
}
.installers-page--all .installers-table-wrap th.col-filename,
.installers-page--all .installers-table-wrap td.col-filename {
  min-width: 160px;
}
.installers-page--all .installer-game-badge {
  display: inline-block;
  max-width: 100%;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.installers-page--all .installer-file-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-all;
}
.installers-page--all .installers-table-wrap .installer-folder-child-name {
  padding-left: 28px;
}
.installers-page--all .installers-table-wrap tr.installer-folder-child td.col-game {
  background: rgba(59, 130, 246, 0.04);
}

/* 파일 서버 탐색기 (MC 스타일) */
.mc-file-explorer {
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.mc-fe-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}
.mc-fe-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.mc-fe-stats {
  font-size: 12px;
  white-space: nowrap;
}
.mc-fe-tree {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px 0 20px;
  scrollbar-gutter: stable;
  font-family: Pretendard, ui-monospace, monospace;
  font-size: 13px;
}
.mc-fe-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 6px;
  min-height: 36px;
}
.mc-fe-row:hover {
  background: rgba(255, 255, 255, 0.04);
}
.mc-fe-row--folder {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
}
.mc-fe-row--folder .mc-fe-folder-name {
  flex: 1;
  min-width: 0;
}
.mc-fe-row--folder.is-open {
  background: rgba(59, 130, 246, 0.08);
}
.mc-fe-toggle {
  min-width: 28px;
  padding: 2px 6px;
}
.mc-fe-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  text-align: center;
}
.mc-fe-icon--file svg {
  display: block;
}
.mc-fe-name {
  flex: 1;
  min-width: 0;
}
.mc-fe-filename {
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
}
.mc-fe-meta {
  font-size: 11px;
  margin-top: 2px;
}
.mc-fe-exclude {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
  cursor: pointer;
}
.mc-fe-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.mc-fe-row--mod {
  min-height: 30px;
  padding: 3px 12px 3px 8px;
}
.mc-fe-name--inline {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.mc-fe-name--inline .mc-fe-meta {
  margin-top: 0;
  font-size: 11px;
}
/* 설치파일 업로드 모달 */
.installer-upload-modal {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.installer-upload-options {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
}
.installer-upload-queue {
  min-height: 80px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}
.installer-upload-queue-empty {
  padding: 20px 14px;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}
.installer-upload-queue-list {
  display: flex;
  flex-direction: column;
}
.installer-upload-queue-tree {
  font-size: 13px;
}
.installer-upload-folder-block {
  border-bottom: 1px solid var(--border);
}
.installer-upload-folder-block:last-child {
  border-bottom: none;
}
.installer-upload-queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.installer-upload-queue-item:last-child {
  border-bottom: none;
}
.installer-upload-queue-icon {
  flex-shrink: 0;
}
.installer-upload-queue-info {
  flex: 1;
  min-width: 0;
}
.installer-upload-queue-name {
  font-weight: 500;
  font-size: 13px;
  word-break: break-all;
}
.installer-upload-queue-exclude {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
  cursor: pointer;
}
.installer-upload-group {
  border-bottom: 1px solid var(--border);
}
.installer-upload-group:last-child {
  border-bottom: none;
}
.installer-upload-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  background: rgba(59, 130, 246, 0.06);
}
.installer-upload-group-head:hover {
  background: rgba(59, 130, 246, 0.1);
}
.installer-upload-group-head.is-open {
  border-bottom: 1px solid var(--border);
}
.installer-upload-group-toggle {
  min-width: 28px;
  padding: 2px 6px;
  flex-shrink: 0;
}
.installer-upload-group-icon {
  flex-shrink: 0;
  font-size: 15px;
}
.installer-upload-group-info {
  flex: 1;
  min-width: 0;
}
.installer-upload-group-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-all;
}
.installer-upload-group-meta {
  font-size: 11px;
  margin-top: 2px;
}
.installer-upload-group-children {
  background: rgba(0, 0, 0, 0.12);
}
.installer-upload-queue-item--nested {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.installer-upload-queue-item--nested:last-child {
  border-bottom: none;
}

/* 파일 관리 — ALL 단일 버튼 */
.installers-game-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}
.installers-game-strip .game-card {
  flex: 0 0 108px;
  width: 108px;
}

/* 파일 관리 — 게임 선택 (썸네일 축소, 파일 목록이 주인공) */
.installers-game-picker {
  padding: 12px 14px !important;
  margin-bottom: 12px;
}

.installers-game-picker .card-title {
  margin-bottom: 8px;
}

.installers-game-picker .game-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  grid-template-columns: unset;
  /* 내부 스크롤 없이 전체 게임이 한눈에 보이도록 */
  max-height: none;
  overflow: visible;
}

.installers-game-picker .game-card {
  flex: 0 0 108px;
  width: 108px;
  max-width: 108px;
}

.installers-game-picker .game-card .thumb {
  aspect-ratio: unset;
  height: 48px;
}

.installers-game-picker .game-card .thumb.all {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: linear-gradient(135deg, var(--bg-surface-2), var(--bg-base));
}
.installers-game-picker .game-card.active .thumb.all {
  color: var(--accent-strong);
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-surface));
}

.installers-game-picker .game-card.card-all .thumb.all {
  min-height: 82px;
  height: 100%;
}

.installers-game-picker .game-card .body {
  padding: 8px 10px 10px;
}

.installers-game-picker .game-card .title {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.installers-game-picker .game-card .meta {
  display: none;
}

/* 액세스 코드 관리 — 상단 게임 선택 + 목록 스크롤 (파일 관리와 동일 패턴) */
.page.page--access-codes {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 28px;
}

.page.page--access-codes > .page-header {
  flex-shrink: 0;
  margin-bottom: 16px;
}

.access-codes-page {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.access-codes-page .access-codes-game-picker,
.access-codes-page .access-codes-toolbar-host {
  flex-shrink: 0;
}

.access-codes-page .access-codes-toolbar-host .toolbar {
  flex-wrap: nowrap;
  margin-bottom: 0;
  width: 100%;
}

.access-codes-page .access-codes-toolbar-host .toolbar .search {
  flex: 1 1 220px;
  min-width: 160px;
  max-width: 420px;
}

.access-codes-page .access-codes-toolbar-host .toolbar .select {
  flex-shrink: 0;
}

.access-codes-page .access-codes-toolbar-host .toolbar .spacer {
  flex: 1 1 12px;
  min-width: 8px;
}

.access-codes-page .access-codes-toolbar-host .toolbar .btn,
.access-codes-page .access-codes-toolbar-host .toolbar .text-faint {
  flex-shrink: 0;
  white-space: nowrap;
}

.access-codes-page .access-codes-list-host {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  margin-top: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.access-codes-page .access-codes-list-host > .table-wrap,
.access-codes-page .access-codes-list-host > .empty,
.access-codes-page .access-codes-list-host > .row {
  flex: 1 1 auto;
  min-height: 0;
}

.access-codes-page .access-codes-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

/* 액세스 코드 목록 — 열 너비 통일 */
.access-codes-table {
  table-layout: fixed;
  min-width: 880px;
}

.access-codes-table .col-code {
  width: 240px;
}

.access-codes-table--with-game .col-code {
  width: 220px;
}

.access-codes-table--with-game .col-game {
  width: 140px;
}

.access-codes-table .col-uses {
  width: 168px;
}

.access-codes-table .col-expires {
  width: 200px;
}

.access-codes-table .col-created {
  width: 120px;
}

.access-codes-table .col-actions {
  width: 168px;
}

.access-codes-table td.col-game,
.access-codes-table td.col-uses,
.access-codes-table td.col-expires,
.access-codes-table td.col-created {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.access-codes-table td.col-actions {
  white-space: nowrap;
}

.access-codes-table td.col-actions .row {
  justify-content: flex-end;
}

.access-codes-game-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.access-codes-game-strip .game-card {
  flex: 0 0 108px;
  width: 108px;
}

.access-codes-game-picker {
  padding: 12px 14px !important;
  margin-bottom: 12px;
}

.access-codes-game-picker .card-title {
  margin-bottom: 8px;
}

.access-codes-game-picker .game-card {
  flex: 0 0 108px;
  width: 108px;
  max-width: 108px;
}

.access-codes-game-picker .game-card .thumb {
  aspect-ratio: unset;
  height: 48px;
}

.access-codes-game-picker .game-card .thumb.all {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: linear-gradient(135deg, var(--bg-surface-2), var(--bg-base));
}

.access-codes-game-picker .game-card.active .thumb.all {
  color: var(--accent-strong);
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-surface));
}

.access-codes-game-picker .game-card .body {
  padding: 8px 10px 10px;
}

.access-codes-game-picker .game-card .title {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.access-codes-game-picker .game-card .meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 4px;
}

.access-codes-game-picker .game-card .meta .badge {
  font-size: 9px;
  padding: 1px 5px;
}

.access-codes-game-picker .game-card .meta .text-faint {
  font-size: 10px;
  line-height: 1.2;
}

/* =====================================================
   모달
   ===================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  /* 스크롤·레이아웃 시 GPU 부담 줄임 (blur 제거) */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}
.modal.large { max-width: 960px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.modal-close:hover { background: var(--bg-surface-2); color: var(--text); }
.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* =====================================================
   토스트
   ===================================================== */
.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}
.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-width: 260px;
  max-width: 380px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
  animation: toast-in 0.18s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   탭
   ===================================================== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* =====================================================
   파일 업로드 드롭존
   ===================================================== */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 128px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: var(--text-muted);
}
.dropzone:hover, .dropzone.over {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}
.dropzone-text,
.dropzone-hint,
.dropzone-filename {
  position: relative;
  z-index: 0;
  pointer-events: none;
}
.dropzone-text { font-size: 13px; font-weight: 500; color: var(--text); }
.dropzone-hint { font-size: 11px; color: var(--text-faint); margin-top: 6px; }
.dropzone-filename { font-size: 13px; color: var(--accent-strong); margin-top: 10px; word-break: break-all; }
/* 브라우저 기본 '파일 선택' 버튼이 왼쪽에 튀어나오는 현상 방지 */
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.progress {
  height: 6px;
  background: var(--bg-base);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 8px;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  border-radius: 9999px;
  width: 0%;
  transition: width 0.12s;
}

/* =====================================================
   기타
   ===================================================== */
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.gap-lg { gap: 16px; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
/* 예전 고정폭(.mono)도 본문과 동일하게 Pretendard */
.mono,
code, pre, kbd, samp {
  font-family: var(--font-sans);
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

.loading {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .page { padding: 20px 16px 48px; }
}

/* =====================================================
   로그인(인증) 화면 — MSAL 게이트
   ===================================================== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(59, 130, 246, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 100%, rgba(34,197,94,0.06), transparent 60%),
    var(--bg-base);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px 28px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.auth-card > img {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 12px;
}
.auth-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 22px;
}
.auth-btn {
  width: 100%;
  justify-content: center;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
}
.auth-error {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--danger-soft);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  color: #fca5a5;
  font-size: 12.5px;
  text-align: left;
  white-space: pre-wrap;
}
.auth-screen .loading {
  margin-top: 12px;
}

/* =====================================================
   로그 페이지 — 필터 그리드 + 통계 분포 막대
   ===================================================== */
.log-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.log-filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.log-filter-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* 2번/3번 줄 사이 일정한 간격 */
.stat-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  align-items: stretch; /* 좌/우 카드 높이 자동 일치 */
}
@media (max-width: 900px) {
  .stat-2col { grid-template-columns: 1fr; }
}
/* grid 컨테이너의 자식 카드에는 어떤 margin-top 도 적용되면 안 됨
   (그러지 않으면 두 번째 카드가 셀 안에서 아래로 밀려나며 높이가 짧아짐) */
.stat-2col > *,
.card-grid > * { margin-top: 0 !important; }

/* 범용 카드 grid (대시보드 등에서 사용) */
.card-grid {
  display: grid;
  gap: 16px;
  align-items: stretch;
}

/* 세로로 쌓이는 통계 카드들 사이 일정한 간격 (grid 외부에서만) */
.stat-2col + .sub-card,
.sub-card + .sub-card,
.sub-card + .stat-2col { margin-top: 16px; }

/* sub-card: 컨텐츠가 카드 전체 높이를 채우도록 flex column */
.sub-card {
  padding: 16px 18px;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  min-height: 220px;          /* 데이터 적어도 일정 높이 유지 */
}
.sub-card .card-title { margin-bottom: 10px; flex: 0 0 auto; }
.sub-card > .empty {
  flex: 1;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sub-card > .distro { flex: 1; }

.distro {
  display: flex; flex-direction: column; gap: 8px;
}
.distro-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3fr auto;
  gap: 10px;
  align-items: center;
  font-size: 12.5px;
}
.distro-label {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.distro-bar {
  height: 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  overflow: hidden;
}
.distro-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}
.distro-fill.danger  { background: linear-gradient(90deg, #ef4444, #f97316); }
.distro-fill.warning { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.distro-value {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 48px;
  text-align: right;
}

/* =====================================================
   Modrinth 검색 모달
   ===================================================== */
.modrinth-toolbar .input,
.modrinth-toolbar .select {
  height: 38px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 36px; /* border 2px 빼고 정확히 38px */
}
.modrinth-toolbar .search {
  position: relative;
  width: 100%;
  max-width: none;
  min-width: 0;
}
.modrinth-toolbar .search input { padding-left: 36px; }
.modrinth-toolbar .search::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>") center / contain no-repeat;
  opacity: 0.8;
  pointer-events: none;
  z-index: 1;
}

.modrinth-version-row {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  margin-bottom: 6px;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.modrinth-version-row:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.06);
}
.modrinth-version-row--selected {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35) inset;
}
.modrinth-version-row--selected:hover {
  border-color: var(--accent-strong) !important;
  background: var(--accent-soft) !important;
}

.page-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}
.page-tabs-row .page-tabs {
  margin-bottom: 0;
}
.page-tabs-row .page-tabs-order-save {
  flex-shrink: 0;
  margin-left: auto;
}
.page-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: fit-content;
}
.page-tab {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.page-tab:hover { background: var(--bg-surface-2); color: var(--text); }
.page-tab.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.games-order-section { margin-bottom: 20px; }
.games-order-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.games-order-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.games-order-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: grab;
  transition: border-color 0.12s, opacity 0.12s;
}
.games-order-item:active { cursor: grabbing; }
.games-order-item.dragging { opacity: 0.45; border-style: dashed; }
.games-order-item.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.games-order-handle {
  color: var(--text-disabled);
  font-size: 14px;
  user-select: none;
  flex-shrink: 0;
}
.games-order-thumb {
  width: 44px;
  height: 30px;
  border-radius: 6px;
  background: var(--bg-surface-2) center/cover no-repeat;
  flex-shrink: 0;
}
.games-order-meta { flex: 1; min-width: 0; }
.games-order-meta .title {
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.games-order-meta .sub {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* 배너 관리 — 등록/수정 모달 */
.modal.banner-editor-modal {
  max-width: min(720px, calc(100vw - 48px));
}
.banner-editor-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.banner-editor-form .image-upload-field {
  margin: 0;
}
.banner-editor-form .image-upload-preview {
  min-height: 160px;
  max-height: 220px;
}
.banner-editor-fields {
  margin: 0;
}
.banner-editor-status .notice-detail-status-toggle {
  margin-top: 2px;
}
.banner-list-thumb {
  width: 120px;
  height: 60px;
  border-radius: 6px;
  background: var(--bg-surface-2) center/cover no-repeat;
}

/* 배너 노출 순서 (드래그) */
.banners-order-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.banners-order-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: grab;
}
.banners-order-item:active { cursor: grabbing; }
.banners-order-item.dragging { opacity: 0.45; border-style: dashed; }
.banners-order-item.drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-surface-2));
}
.banners-order-handle {
  color: var(--text-faint);
  font-size: 14px;
  user-select: none;
  flex-shrink: 0;
}
.banners-order-thumb {
  width: 96px;
  height: 48px;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--bg-base) center/cover no-repeat;
}
.banners-order-meta {
  flex: 1;
  min-width: 0;
}
.banners-order-meta .title {
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.banners-order-meta .sub {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* 공지 관리 — 상세 / 편집 모달 (동일 레이아웃) */
.modal.notice-detail-modal {
  max-width: min(720px, calc(100vw - 48px));
}
.notice-detail-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.notice-detail-mode-chip {
  display: none;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.notice-detail-modal--editing .notice-detail-mode-chip {
  display: inline-flex;
}
.notice-detail-modal--editing .notice-detail {
  outline: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  outline-offset: 0;
  border-radius: var(--radius-lg);
  padding: 14px 16px 16px;
  background: var(--bg-surface);
}
.notices-row.clickable {
  cursor: pointer;
}
.notices-row.clickable:hover td {
  background: var(--bg-surface-2);
}
.notice-detail[data-mode="view"] .notice-detail-edit {
  display: none !important;
}
.notice-detail[data-mode="edit"] .notice-detail-view {
  display: none !important;
}
.notice-detail--create .notice-detail-view {
  display: none !important;
}
.notice-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  min-height: 32px;
}
.notice-detail-badge-slot {
  display: inline-flex;
}
.notice-detail-id {
  font-size: 12px;
  margin-left: auto;
}
.notice-detail-head-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 20px;
  flex: 1;
  min-width: 0;
}
.notice-detail-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.notice-detail-control-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.notice-detail-status-toggle {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-base);
}
.notice-detail-pill {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.notice-detail-pill + .notice-detail-pill {
  border-left: 1px solid var(--border);
}
.notice-detail-pill:hover {
  color: var(--text-primary);
  background: var(--bg-surface-2);
}
.notice-detail-pill.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}
.notice-detail-type-select {
  min-width: 128px;
  max-width: 100%;
}
.notice-detail-meta {
  font-size: 12.5px;
  margin-bottom: 14px;
}
.notice-detail-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 14px;
  line-height: 1.35;
}
.notice-detail-title-input {
  width: 100%;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 14px;
  padding: 10px 12px;
  box-sizing: border-box;
}
.notice-detail-content,
.notice-detail-content-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.65;
  max-height: min(50vh, 420px);
  word-break: break-word;
}
.notice-detail-content {
  overflow-y: auto;
  white-space: pre-wrap;
}
.notice-detail-content-input {
  min-height: 200px;
  resize: vertical;
  display: block;
}
.notice-detail[data-mode="edit"] .notice-detail-content-input,
.notice-detail--create .notice-detail-content-input {
  border-color: var(--border-strong);
  background: var(--bg-base);
}
.notice-detail[data-mode="edit"] .notice-detail-title-input,
.notice-detail--create .notice-detail-title-input {
  border-color: var(--border-strong);
  background: var(--bg-base);
}

.launcher-dir-item--root .launcher-dir-item-icon { opacity: 0.7; }

.modrinth-search-row:hover {
  background: var(--bg-surface-2);
}
.modrinth-search-row + .modrinth-search-row { border-top: 0; } /* 중복 보더 방지 */

.modrinth-version-row:hover {
  border-color: var(--border-strong) !important;
  background: var(--bg-surface-2) !important;
}

@media (max-width: 720px) {
  .modrinth-toolbar {
    grid-template-columns: 1fr !important;
  }
}

/* =====================================================
   사이드바 사용자 영역 (로그인된 계정 + 로그아웃)
   ===================================================== */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.sidebar-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-user .user-info {
  flex: 1;
  min-width: 0;
}
.sidebar-user .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user .user-mail {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 1px;
}
.sidebar-user .logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.sidebar-user .logout-btn:hover {
  background: var(--danger-soft);
  border-color: rgba(239,68,68,0.35);
  color: #fca5a5;
}

/* =====================================================
   대시보드 — 최근 활동 피드
   ===================================================== */
.activity-row {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.activity-row:last-child { border-bottom: none; }
.activity-body { flex: 1; min-width: 0; }
.activity-action {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
}
.activity-actor {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-faint);
  white-space: nowrap;
}
.activity-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-time {
  font-size: 11.5px;
  white-space: nowrap;
  padding-top: 1px;
  flex-shrink: 0;
}

/* 런처 버전 관리 — 상단 버전 카드 */
.launcher-version-page .card:first-of-type {
  padding: 16px 18px;
}
.launcher-version-page .card:first-of-type .row.between {
  align-items: flex-start;
  gap: 16px;
}

/* =====================================================
   런처 파일 — 폴더 + 파일 테이블
   ===================================================== */
.launcher-files-card .toolbar {
  margin-bottom: 0;
}
.launcher-files-summary {
  font-size: 12px;
  color: var(--text-faint);
  margin: 12px 0 10px;
}
.launcher-files-layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.launcher-dir-panel {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}
.launcher-dir-panel-title {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}
.launcher-dir-list {
  overflow-y: auto;
  padding: 6px;
  flex: 1;
  min-height: 0;
}
.launcher-dir-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.launcher-dir-item:hover {
  background: var(--bg-surface-2);
}
.launcher-dir-item.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.launcher-dir-item-icon {
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1;
}
.launcher-dir-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.launcher-dir-item-meta {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  background: var(--bg-surface-2);
  border-radius: 9999px;
  padding: 2px 7px;
}
.launcher-dir-item.active .launcher-dir-item-meta {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-strong);
}
.launcher-files-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.launcher-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}
.launcher-crumb {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
}
.launcher-crumb:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}
.launcher-crumb.active {
  color: var(--accent-strong);
  font-weight: 600;
}
.launcher-crumb-sep {
  color: var(--text-disabled);
  user-select: none;
}
.launcher-files-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.launcher-files-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-all;
}
.launcher-files-panel-count {
  font-size: 12px;
}
.launcher-subdir-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.launcher-subdir-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-base);
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.launcher-subdir-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.launcher-subdir-chip-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
}
.launcher-file-table-wrap {
  border-radius: var(--radius-lg);
}
.launcher-file-table {
  min-width: 640px;
}
.launcher-file-table .launcher-col-actions {
  width: 1%;
  white-space: nowrap;
}
.launcher-file-name {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}
.launcher-table-empty {
  text-align: center;
  color: var(--text-faint);
  padding: 28px 16px !important;
}
.launcher-files-search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.launcher-files-search-hint {
  font-size: 12px;
}

@media (max-width: 960px) {
  .launcher-files-layout {
    grid-template-columns: 1fr;
  }
  .launcher-dir-panel {
    position: static;
    max-height: 240px;
  }
}

/* =====================================================
   대시보드 — 런처 로그 요약 mini KPI 타일
   ===================================================== */
.dash-log-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.dash-log-tile {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.dash-log-tile:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dash-log-tile.warn {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
}
.dash-log-tile.warn:hover {
  border-color: rgba(239, 68, 68, 0.65);
  background: rgba(239, 68, 68, 0.12);
}
.dash-log-icon { font-size: 18px; line-height: 1; }
.dash-log-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
}
.dash-log-tile.warn .dash-log-value { color: #f87171; }
.dash-log-label {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* 최근 오류 리스트 */
.dash-error-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-error-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.dash-error-body { flex: 1; min-width: 0; }
.dash-error-msg {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-error-meta {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* 사용자 관리 — 보유 게임 호버 목록 */
.hover-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: min(360px, calc(100vw - 24px));
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-primary);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  white-space: pre-line;
}

/* 다운로드 로그 — 세션(한 번의 설치) 단위 묶음 */
.download-sessions-table .download-session-row {
  cursor: pointer;
}
.download-sessions-table .download-session-row:hover {
  background: rgba(255, 255, 255, 0.03);
}
.download-sessions-table .download-session-row.is-expanded {
  background: rgba(59, 130, 246, 0.08);
}
.download-session-toggle-cell {
  width: 36px;
  padding-left: 10px !important;
  padding-right: 4px !important;
}
.download-session-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  line-height: 1;
}
.download-session-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.download-session-detail > td {
  padding: 0 !important;
  border-top: none;
  background: rgba(0, 0, 0, 0.15);
}
.download-session-files {
  padding: 10px 12px 12px 42px;
}
.download-files-table {
  font-size: 12.5px;
}
.download-files-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
}
.download-files-table td {
  padding-top: 6px;
  padding-bottom: 6px;
}

.web-activity-detail-cell {
  min-width: 200px;
  max-width: 360px;
}
.web-activity-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.web-activity-summary {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-primary);
}
.web-activity-detail-btn {
  flex-shrink: 0;
}

.dash-activity-detail {
  max-width: 520px;
  white-space: normal;
  vertical-align: top;
}
.dash-activity-detail-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-primary);
  word-break: break-word;
}

/* 사용자 관리 — 페이지당 10명, 목록 내부 스크롤 없음 (페이저는 표 아래 고정 배치) */
.page.page--users {
  display: block;
  padding-bottom: 28px;
}

.page.page--users > .page-header {
  margin-bottom: 16px;
}

.users-page {
  display: block;
}

.users-page .users-game-picker,
.users-page .users-toolbar-host {
  flex-shrink: 0;
}

.users-page .users-toolbar-host .toolbar {
  flex-wrap: nowrap;
  margin-bottom: 0;
  width: 100%;
}

.users-page .users-toolbar-host .toolbar .search {
  flex: 1 1 220px;
  min-width: 160px;
  max-width: 420px;
}

.users-page .users-toolbar-host .toolbar .select {
  flex-shrink: 0;
}

.users-page .users-toolbar-host .toolbar .spacer {
  flex: 1 1 12px;
  min-width: 8px;
}

.users-page .users-toolbar-host .toolbar .btn,
.users-page .users-toolbar-host .toolbar .text-faint {
  flex-shrink: 0;
  white-space: nowrap;
}

.users-page .users-list-host {
  margin-top: 16px;
  min-width: 0;
}

.users-page .users-list-host > .users-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

.users-list-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 14px;
  padding-top: 0;
  padding-bottom: 8px;
}

.users-list-pager-btns {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.users-list-pager-num {
  font-size: 12.5px;
  min-width: 4.5em;
  text-align: center;
}

.users-table-games-count {
  font-size: 13px;
  color: var(--text-secondary);
  cursor: default;
}

.users-game-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.users-game-strip .game-card {
  flex: 0 0 108px;
  width: 108px;
}

.users-game-picker {
  padding: 12px 14px !important;
  margin-bottom: 12px;
}

.users-game-picker .card-title {
  margin-bottom: 8px;
}

.users-game-picker .game-card .thumb {
  aspect-ratio: unset;
  height: 48px;
}

.users-game-picker .game-card .thumb.all {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: linear-gradient(135deg, var(--bg-surface-2), var(--bg-base));
}

.users-game-picker .game-card.active .thumb.all {
  color: var(--accent-strong);
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-surface));
}

.users-game-picker .game-card .body {
  padding: 8px 10px 10px;
}

.users-game-picker .game-card .title {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.users-game-picker .game-card .meta {
  font-size: 10.5px;
  margin-top: 4px;
}

.users-list-banner {
  margin-bottom: 12px;
}

.users-table {
  table-layout: fixed;
  min-width: 1040px;
}

.users-table .col-status { width: 108px; }
.users-table .col-name { width: 200px; }
.users-table .col-uuid { width: 200px; }
.users-table .col-role { width: 72px; }
.users-table .col-games { width: 88px; }
.users-table .col-login { width: 108px; }
.users-table .col-ip { width: 120px; }
.users-table .col-created { width: 100px; min-width: 100px; }
.users-table .col-actions { width: 168px; }
.users-page.page--users-filter-game .users-table {
  min-width: 1080px;
}
.users-page.page--users-filter-game .users-table .col-actions { width: 220px; }
.users-page.page--users-filter-game .users-table .col-uuid { width: 168px; }
.users-page.page--users-filter-game .users-table .col-ip { width: 108px; }

.users-table-name {
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-table-sub,
.users-table-uuid {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.users-table td.col-login,
.users-table td.col-ip,
.users-table td.col-created,
.users-table td.col-games,
.users-table td.col-role {
  white-space: nowrap;
}

.users-table td.col-actions {
  white-space: nowrap;
}

.users-table td.col-actions .row-actions {
  justify-content: flex-end;
}

.users-table tbody tr {
  vertical-align: middle;
}

/* 사용자 관리 — 게임 필터 배너 + 권한 추가 드롭다운 */
.users-game-filter-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.users-game-filter-summary {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: baseline;
  min-width: 0;
  gap: 0 0.75em;
}
.users-game-filter-name {
  font-weight: 600;
  color: var(--text-primary);
}
.users-game-filter-meta {
  font-size: 13px;
}
.users-game-add {
  position: relative;
  flex-shrink: 0;
}
.users-game-add-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: min(320px, calc(100vw - 48px));
  max-height: min(360px, 50vh);
  padding: 8px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.45);
  flex-direction: column;
  gap: 8px;
}
.users-game-add-menu.is-open {
  display: flex;
}
.users-game-add-search {
  width: 100%;
  box-sizing: border-box;
  font-size: 13px;
  padding: 8px 10px;
}
.users-game-add-list {
  overflow-y: auto;
  max-height: min(280px, 42vh);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.users-game-add-empty {
  padding: 12px 10px;
  font-size: 12.5px;
  text-align: center;
}
.users-game-add-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.users-game-add-item:hover:not(:disabled) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-surface-2));
}
.users-game-add-item:disabled {
  opacity: 0.55;
  cursor: wait;
}
.users-game-add-item-name {
  font-weight: 600;
  font-size: 13px;
}
.users-game-add-item-sub {
  font-size: 11px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table tr.users-row--admin td {
  background: rgba(59, 130, 246, 0.06);
}
.table tbody tr.users-row--admin + tr:not(.users-row--admin) td {
  border-top: 2px solid var(--border);
}
