/* ─── 다크 테마 (기본) ──────────────────────────────────── */
:root {
  --bg:          #090d18;
  --bg-card:     #111827;
  --bg-hover:    #1a2235;
  --bg-nav:      #0b0f1c;
  --bg-darker:   #0d1219;
  --border:      #1f2937;
  --border-2:    #374151;
  --accent:      #f59e0b;
  --accent-l:    #fbbf24;
  --accent-r:    245,158,11;        /* rgba용 */
  --text:        #e5e7eb;
  --text-2:      #9ca3af;
  --text-3:      #6b7280;
  --success:     #10b981;
  --danger:      #ef4444;
  --danger-h:    #dc2626;
  --showcase-gradient: linear-gradient(160deg, #0d1525 0%, #1a2640 60%, #0d1219 100%);
}

/* ─── 라이트 테마 ─────────────────────────────────────── */
[data-theme="light"] {
  --bg:          #f3f4f6;
  --bg-card:     #ffffff;
  --bg-hover:    #f9fafb;
  --bg-nav:      #ffffff;
  --bg-darker:   #f3f4f6;
  --border:      #e5e7eb;
  --border-2:    #d1d5db;
  --accent:      #d97706;
  --accent-l:    #f59e0b;
  --accent-r:    217,119,6;
  --text:        #111827;
  --text-2:      #6b7280;
  --text-3:      #9ca3af;
  --success:     #059669;
  --danger:      #dc2626;
  --danger-h:    #b91c1c;
  --showcase-gradient: linear-gradient(160deg, #dbeafe 0%, #eff6ff 60%, #e0f2fe 100%);
}

/* ─── Reset & Base ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  transition: background .25s, color .25s;
}

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

/* ─── Navbar ──────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 200;
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px;
  transition: background .25s, border-color .25s;
}
[data-theme="light"] .navbar {
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.nav-brand {
  font-size: 1.05rem; font-weight: 700;
  color: var(--accent); letter-spacing: -0.3px;
}
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-link {
  padding: 6px 14px; border-radius: 6px;
  color: var(--text-2); font-size: 0.87rem; font-weight: 500;
  transition: all .15s;
}
.nav-link:hover { background: var(--bg-card); color: var(--text); }
.nav-link.active {
  background: rgba(var(--accent-r),.12);
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

/* 테마 토글 버튼 */
.theme-toggle {
  width: 32px; height: 32px; border-radius: 8px;
  background: none; border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s; margin-left: 8px; flex-shrink: 0;
}
.theme-toggle:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-2); }

/* ─── Layout ──────────────────────────────────────────── */
.container { max-width: 1440px; margin: 0 auto; padding: 28px 24px; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.page-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.5px; }
.page-subtitle { font-size: 0.85rem; color: var(--text-2); margin-top: 4px; }
.api-notice {
  background: rgba(var(--accent-r),.1); border: 1px solid rgba(var(--accent-r),.3);
  color: var(--accent); padding: 6px 14px; border-radius: 20px; font-size: 0.8rem;
}

/* ─── Buttons ─────────────────────────────────────────── */
.btn {
  padding: 9px 18px; border-radius: 8px; border: none;
  cursor: pointer; font-size: 0.87rem; font-weight: 600;
  transition: all .15s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--accent); color: #111; }
.btn-primary:hover { background: var(--accent-l); }
.btn-secondary {
  background: var(--bg-card); border: 1px solid var(--border-2);
  color: var(--text);
}
.btn-secondary:hover { background: var(--bg-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-h); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-icon {
  width: 28px; height: 28px; border-radius: 6px;
  background: none; border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text); }

/* ─── Inputs ──────────────────────────────────────────── */
.input {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 14px;
  color: var(--text); font-size: 0.87rem; outline: none;
  transition: border-color .15s; width: 100%;
  font-family: inherit;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-3); }
select.input { cursor: pointer; }

/* ─── Forms ───────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 0.82rem; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
.form-row { display: flex; gap: 10px; align-items: flex-end; }
.form-hint { font-size: 0.78rem; color: var(--text-3); margin-top: 6px; }

/* ─── Section ─────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px;
}
.section-title { font-size: 1rem; font-weight: 700; }
.section-sub { font-size: 0.8rem; color: var(--text-2); }
.week-badge {
  background: rgba(var(--accent-r),.12); border: 1px solid rgba(var(--accent-r),.3);
  color: var(--accent); padding: 4px 12px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 500; white-space: nowrap;
}

/* ─── Add Character Form ──────────────────────────────── */
.add-char-section { margin-bottom: 28px; }
.add-char-form { display: flex; gap: 10px; align-items: center; max-width: 480px; }
.add-char-form .input { flex: 1; }

/* ─── Character Grid ──────────────────────────────────── */
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.character-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; position: relative;
  transition: border-color .2s;
}
.character-card:hover { border-color: var(--border-2); }

/* ── 이미지 쇼케이스 ─────────────────────────────────── */
.char-showcase {
  position: relative;
  height: 180px;
  background: var(--showcase-gradient);
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
  transition: background .25s;
}
.char-showcase::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 110%, rgba(var(--accent-r),.08) 0%, transparent 70%);
}
.char-showcase-img {
  height: 175px; width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  position: relative; z-index: 1;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.5));
}
.char-showcase-placeholder {
  font-size: 72px; display: flex;
  align-items: center; justify-content: center;
  width: 100%; height: 100%;
  opacity: .35;
}
.char-card-actions {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: flex; gap: 6px;
}
.btn-refresh {
  font-size: 16px;
  background: rgba(0,0,0,.4); border-color: rgba(255,255,255,.15);
}
.btn-refresh:hover { background: rgba(var(--accent-r),.25); border-color: var(--accent); color: var(--accent); }
.btn-remove  { background: rgba(0,0,0,.4); border-color: rgba(255,255,255,.15); }
.btn-remove:hover  { background: var(--danger); border-color: var(--danger); color: #fff; }

[data-theme="light"] .btn-refresh,
[data-theme="light"] .btn-remove {
  background: rgba(255,255,255,.75);
  border-color: rgba(0,0,0,.15);
  color: var(--text-2);
}

/* ── 캐릭터 정보 ─────────────────────────────────────── */
.char-info-row {
  padding: 12px 16px 8px;
}
.char-name { font-size: 1rem; font-weight: 700; margin-bottom: 3px; }
.char-sub  { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.char-job  { font-size: 0.78rem; color: var(--accent); }
.char-level-badge {
  font-size: 0.72rem; color: var(--text-2);
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  padding: 1px 7px; border-radius: 20px;
}
[data-theme="light"] .char-level-badge {
  background: var(--bg-hover);
}

/* ── 경험치 바 ───────────────────────────────────────── */
.char-exp-row { margin-bottom: 4px; }
.exp-bar-wrap {
  height: 5px; background: rgba(255,255,255,.07);
  border-radius: 3px; overflow: hidden; margin-bottom: 4px;
}
[data-theme="light"] .exp-bar-wrap { background: var(--border); }
.exp-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-l));
  border-radius: 3px; transition: width .5s ease;
  min-width: 2px;
}
.exp-stats { display: flex; align-items: center; gap: 8px; }
.exp-rate-val   { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.exp-daily-gain {
  font-size: 0.72rem; color: var(--success);
  background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25);
  padding: 1px 7px; border-radius: 20px;
}

/* ── 차트 ────────────────────────────────────────────── */
.chart-wrap { position: relative; height: 100px; padding: 0 16px 8px; }
.chart-no-data {
  height: 90px; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 0.78rem; border: 1px dashed var(--border);
  border-radius: 6px; margin: 0 16px 8px;
}
.char-updated {
  font-size: 0.68rem; color: var(--text-3);
  padding: 0 16px 10px; display: block;
}

/* ─── Weekly Summary ──────────────────────────────────── */
.weekly-section { margin-top: 44px; }
.weekly-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 14px;
}
.weekly-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px;
}
.weekly-card.current { border-color: rgba(var(--accent-r),.4); }
.weekly-label { font-size: 0.78rem; color: var(--text-2); margin-bottom: 6px; }
.weekly-range { color: var(--text-3); font-size: 0.72rem; margin-left: 4px; }
.weekly-amount {
  font-size: 1.35rem; font-weight: 700; color: var(--accent);
}
.weekly-card.prev .weekly-amount { font-size: 1.05rem; }

/* ─── Boss Page ───────────────────────────────────────── */
.total-profit-bar {
  background: var(--bg-card); border: 1px solid rgba(var(--accent-r),.3);
  border-radius: 10px; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.total-label { font-size: 0.85rem; color: var(--text-2); font-weight: 500; }
.total-amount { font-size: 1.4rem; font-weight: 700; color: var(--accent); }

.char-summary-bar {
  display: flex; flex-wrap: wrap; gap: 6px 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 16px;
  margin-bottom: 20px;
}
.char-summary-item {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; font-size: .8rem;
  border-right: 1px solid var(--border);
}
.char-summary-item:last-child { border-right: none; }
.char-summary-name  { color: var(--text-1); font-weight: 600; }
.char-summary-bosses { color: var(--text-2); }
.char-summary-profit { color: var(--accent); font-weight: 700; }

.boss-scroll-wrap { overflow-x: auto; padding-bottom: 8px; }
.boss-columns { display: flex; width: max-content; border-radius: 12px; overflow: hidden; }

.boss-col {
  min-width: 185px; max-width: 185px;
  border: 1px solid var(--border);
  border-right: none; display: flex; flex-direction: column;
  background: var(--bg-card);
}
.boss-col:first-child { border-radius: 12px 0 0 12px; }
.boss-col:last-child  { border-right: 1px solid var(--border); border-radius: 0 12px 12px 0; }

.boss-col-header {
  padding: 12px; border-bottom: 1px solid var(--border);
  background: var(--bg-darker); text-align: center;
  transition: background .25s;
}
.boss-col-charname { font-weight: 700; font-size: 0.9rem; }
.boss-col-charinfo  { font-size: 0.72rem; color: var(--text-2); margin-top: 2px; }

.boss-col-list { flex: 1; padding: 6px; }
.boss-empty { font-size: 0.78rem; color: var(--text-3); text-align: center; padding: 16px 8px; }

.boss-item {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 6px; border-radius: 6px;
  cursor: pointer; transition: background .12s;
  border-bottom: 1px solid var(--border);
}
.boss-item:last-child { border-bottom: none; }
.boss-item:hover { background: var(--bg-hover); }
.boss-check {
  width: 15px; height: 15px; flex-shrink: 0;
  accent-color: var(--accent); cursor: pointer;
}
.boss-item-info { flex: 1; min-width: 0; }
.boss-item-name {
  font-size: 0.8rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.boss-item-meta { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.boss-item-party { font-size: 0.7rem; color: var(--text-3); }
.boss-item-profit { font-size: 0.72rem; color: var(--accent); flex-shrink: 0; font-weight: 500; }

.boss-item.cleared .boss-item-name { text-decoration: line-through; color: var(--text-3); }
.boss-item.cleared { opacity: .7; }

/* ─── 전체 체크 버튼 ─────────────────────────────────── */
.boss-checkall-btn {
  margin-top: 7px;
  width: 100%; padding: 4px 0;
  background: rgba(var(--accent-r),.1); color: var(--accent);
  border: 1px solid rgba(var(--accent-r),.3); border-radius: 6px;
  font-size: 0.72rem; cursor: pointer; transition: background .15s;
}
.boss-checkall-btn:hover { background: rgba(var(--accent-r),.2); }
.boss-checkall-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ─── 주차 탭 ────────────────────────────────────────── */
.week-tab-bar {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.week-tab {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-2); text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
  min-width: 88px;
}
.week-tab:hover { border-color: var(--accent); color: var(--accent); }
.week-tab.active {
  background: rgba(var(--accent-r),.12); border-color: var(--accent);
  color: var(--accent);
}
.week-tab-label { font-size: 0.8rem; font-weight: 600; }
.week-tab-date  { font-size: 0.68rem; margin-top: 2px; opacity: .75; }


/* ─── 캐릭터 필터 바 ─────────────────────────────────── */
.char-filter-bar {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px; margin-bottom: 16px;
}
.char-filter-label { font-size: 0.78rem; color: var(--text-2); margin-right: 2px; }
.char-filter-chip {
  padding: 4px 12px; border-radius: 20px; font-size: 0.78rem; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-2); transition: all .15s;
}
.char-filter-chip.active {
  border-color: var(--accent); background: rgba(var(--accent-r),.12);
  color: var(--accent);
}

.boss-col-footer {
  padding: 10px 12px; border-top: 1px solid var(--border);
  background: var(--bg-darker); text-align: center;
  transition: background .25s;
}
.char-total-label  { font-size: 0.7rem; color: var(--text-2); }
.char-total-amount { font-size: 0.95rem; font-weight: 700; color: var(--accent); }

/* ─── Screenshot Gallery ─────────────────────────────── */
.screenshot-section { margin-bottom: 40px; }

.screenshot-dropzone {
  border: 2px dashed var(--border); border-radius: 12px;
  background: var(--bg-card); margin-bottom: 16px;
  transition: border-color .2s, background .2s;
  cursor: pointer;
}
.screenshot-dropzone:hover,
.screenshot-dropzone.drag-over {
  border-color: var(--accent); background: rgba(var(--accent-r),.05);
}
.screenshot-dropzone.uploading { opacity: .6; pointer-events: none; }
.dropzone-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 28px;
}
.dropzone-icon { font-size: 2rem; }
.dropzone-text { font-size: 0.9rem; color: var(--text); }
.dropzone-sub  { font-size: 0.76rem; color: var(--text-2); }

.screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.screenshot-thumb {
  position: relative; border-radius: 8px; overflow: hidden;
  background: var(--bg-card); aspect-ratio: 16/9;
  border: 1px solid var(--border); transition: opacity .2s;
}
.screenshot-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  cursor: zoom-in; transition: transform .2s;
}
.screenshot-thumb:hover img { transform: scale(1.04); }
.screenshot-del-btn {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,.65); color: #fff;
  border: none; border-radius: 50%; width: 22px; height: 22px;
  font-size: 0.65rem; cursor: pointer; display: none;
  align-items: center; justify-content: center;
}
.screenshot-thumb:hover .screenshot-del-btn { display: flex; }

.screenshot-empty,
.screenshot-loading { font-size: 0.82rem; color: var(--text-2); padding: 8px 0; }

/* ─── Lightbox ───────────────────────────────────────── */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.88); align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw; max-height: 90vh;
  border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.lightbox-close {
  position: fixed; top: 20px; right: 24px;
  background: rgba(255,255,255,.1); border: none; color: #fff;
  font-size: 1.2rem; width: 38px; height: 38px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,.2); }

/* ─── Boss Drag Sort ──────────────────────────────────── */
.drag-handle {
  font-size: 1.1rem; color: var(--text-3);
  cursor: grab; padding: 0 8px 0 0;
  user-select: none; flex-shrink: 0; line-height: 1;
}
.drag-handle:active { cursor: grabbing; }
.boss-card.dragging  { opacity: 0.4; }
.boss-card.drag-over {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(var(--accent-r),.18);
}

/* ─── Diff Badge ──────────────────────────────────────── */
.diff-badge {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 0.68rem; font-weight: 600;
}
/* 다크 */
.diff-badge.이지   { background: #065f46; color: #6ee7b7; }
.diff-badge.노멀   { background: #1e3a8a; color: #93c5fd; }
.diff-badge.하드   { background: #7f1d1d; color: #fca5a5; }
.diff-badge.카오스 { background: #4c1d95; color: #c4b5fd; }
/* 라이트 */
[data-theme="light"] .diff-badge.이지   { background: #d1fae5; color: #065f46; }
[data-theme="light"] .diff-badge.노멀   { background: #dbeafe; color: #1e40af; }
[data-theme="light"] .diff-badge.하드   { background: #fee2e2; color: #991b1b; }
[data-theme="light"] .diff-badge.카오스 { background: #ede9fe; color: #5b21b6; }

/* ─── Admin Page ──────────────────────────────────────── */
.admin-tabs {
  display: flex; gap: 0; margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.admin-tab {
  padding: 10px 22px; cursor: pointer; border: none; background: none;
  color: var(--text-2); font-size: 0.9rem; font-weight: 500;
  border-bottom: 2px solid transparent; transition: all .15s;
  font-family: inherit;
}
.admin-tab:hover  { color: var(--text); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.admin-panel { display: none; }
.admin-panel.active { display: block; }

.admin-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 20px;
}
.admin-section-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 16px; }

/* Boss add form - difficulty rows */
.diff-row-header {
  display: grid; grid-template-columns: 1fr 100px 160px 32px;
  gap: 8px; padding: 6px 4px;
  font-size: 0.75rem; color: var(--text-2); font-weight: 500;
}
.diff-row {
  display: grid; grid-template-columns: 1fr 100px 160px 32px;
  gap: 8px; margin-bottom: 6px;
}

.boss-add-form { max-width: 680px; }

/* Boss cards in admin - tile grid */
#bossList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 8px;
}
.boss-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
}
.boss-card-top { display: flex; align-items: center; gap: 5px; margin-bottom: 8px; }
.boss-card-name {
  flex: 1; font-weight: 600; font-size: 0.88rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.boss-card-btns { display: flex; gap: 4px; flex-shrink: 0; }

.diff-list { display: flex; flex-wrap: wrap; gap: 5px; }
.diff-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 5px; padding: 3px 7px; font-size: 0.74rem; color: var(--text-2);
}

/* Admin char list */
.admin-char-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 8px;
}
.admin-char-info { display: flex; align-items: center; gap: 12px; }
.admin-char-img  { width: 48px; height: 48px; border-radius: 6px; object-fit: contain; background: var(--bg-hover); }
.admin-char-name { font-weight: 600; font-size: 0.9rem; }
.admin-char-meta { font-size: 0.75rem; color: var(--text-2); margin-top: 2px; }

/* Boss assignment - tile grid */
.assign-count {
  font-size: 0.85rem; color: var(--text-2); margin-bottom: 14px;
}
.assign-count span { font-weight: 700; color: var(--accent); }
.assign-boss-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.assign-boss-group {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.assign-boss-name {
  font-weight: 600; font-size: 0.8rem; color: var(--text);
  padding: 6px 10px 5px; background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.assign-diff-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 5px 8px; transition: background .12s;
  font-size: 0.8rem; color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.assign-diff-item:last-child { border-bottom: none; }
.assign-diff-item:hover { background: var(--bg-hover); }
.assign-diff-item.assigned { background: rgba(var(--accent-r),.06); }
.assign-diff-label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.assign-diff-item input { accent-color: var(--accent); cursor: pointer; }
.assign-party-ctrl { display: flex; align-items: center; gap: 5px; padding-left: 20px; }
.assign-party-ctrl.hidden { display: none; }
.assign-party-select { width: 58px !important; padding: 2px 5px !important; font-size: 0.74rem !important; }
.assign-profit-label { font-size: 0.73rem; color: var(--accent); font-weight: 500; }
.hidden { display: none !important; }

/* ─── Empty State ─────────────────────────────────────── */
.empty-state { text-align: center; padding: 64px 20px; color: var(--text-2); }
.empty-icon  { font-size: 48px; margin-bottom: 14px; }
.empty-state p { font-size: 0.9rem; line-height: 1.8; }

/* ─── Toast ───────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border-2);
  border-radius: 8px; padding: 11px 18px; font-size: 0.87rem;
  max-width: 320px; animation: toastIn .25s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
@keyframes toastIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: none; } }

/* ─── Spinner ─────────────────────────────────────────── */
.spinner {
  width: 14px; height: 14px; border: 2px solid rgba(0,0,0,.3);
  border-top-color: #111; border-radius: 50%; animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── 주간 히스토리 메모 ─────────────────────────────────── */
.memo-section { margin-top: 32px; }
.memo-section-title {
  font-size: .95rem; font-weight: 700;
  color: var(--text-1); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.memo-week-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px;
}
.memo-week-tab {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 7px 13px; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer; transition: border-color .18s, background .18s;
  min-width: 82px;
}
.memo-week-tab:hover { border-color: var(--accent); }
.memo-week-tab.active {
  border-color: var(--accent);
  background: rgba(var(--accent-r, 99), var(--accent-g, 102), var(--accent-b, 241), .08);
}
.memo-tab-main { font-size: .8rem; font-weight: 600; color: var(--text-1); }
.memo-tab-range { font-size: .68rem; color: var(--text-2); margin-top: 2px; white-space: nowrap; }
.memo-week-tab.active .memo-tab-main { color: var(--accent); }

.memo-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px;
}
@media (max-width: 640px) { .memo-grid { grid-template-columns: 1fr; } }

.memo-col {
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden;
}
.memo-col-header {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.memo-col-header-row {
  display: flex; align-items: center; justify-content: space-between;
}
.memo-col-title {
  font-size: .82rem; font-weight: 700; color: var(--text-1);
}
.memo-col-sub {
  font-size: .72rem; color: var(--text-2); margin-top: 2px;
}
.history-ingo-sum {
  font-size: .78rem; font-weight: 700; color: #22c55e;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.28);
  border-radius: 6px; padding: 3px 10px; white-space: nowrap;
}
/* ─── 히스토리 피드 ──────────────────────────────────────── */
.history-feed {
  flex: 1; overflow-y: auto; min-height: 150px; max-height: 300px;
  padding: 10px 14px; display: flex; flex-direction: column; gap: 5px;
}
.history-entry {
  display: flex; align-items: baseline; gap: 10px;
  padding: 4px 6px; border-radius: 5px;
  transition: background .12s;
}
.history-entry:hover { background: var(--bg-secondary); }
.history-entry-ts {
  font-size: .72rem; color: var(--text-2);
  white-space: nowrap; flex-shrink: 0; user-select: none;
}
.history-entry-text {
  color: var(--text-1); font-size: .84rem;
  flex: 1; word-break: break-all; line-height: 1.5;
}
.history-entry-del {
  background: none; border: none; cursor: pointer;
  color: var(--text-2); font-size: .78rem; padding: 0 3px;
  opacity: 0; transition: opacity .15s; flex-shrink: 0;
}
.history-entry:hover .history-entry-del { opacity: 1; }
.history-entry-del:hover { color: var(--danger); }
.history-empty {
  font-size: .8rem; color: var(--text-2);
  padding: 24px 0; text-align: center;
}
.history-input-row {
  display: flex; gap: 8px;
  padding: 10px 14px; border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}
.history-input {
  flex: 1; padding: 7px 11px;
  background: var(--bg-card); color: var(--text-1);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: .83rem; font-family: inherit; outline: none;
  transition: border-color .15s;
}
.history-input:focus { border-color: var(--accent); }

.memo-textarea {
  flex: 1; width: 100%; min-height: 180px;
  padding: 13px 14px; resize: vertical;
  border: none; outline: none;
  background: var(--bg-card); color: var(--text-1);
  font-size: .85rem; line-height: 1.6;
  font-family: inherit;
}
.memo-textarea:focus { background: var(--bg-hover, var(--bg-card)); }
.memo-textarea[readonly] { opacity: .65; cursor: default; resize: none; }

.memo-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  gap: 10px;
}
.memo-updated-at { font-size: .72rem; color: var(--text-2); }
.memo-save-row { display: flex; align-items: center; gap: 10px; }
.memo-save-indicator {
  font-size: .75rem; color: var(--success, #22c55e);
  opacity: 0; transition: opacity .35s;
}
.memo-save-indicator.show { opacity: 1; }

/* ─── 스카우터 사이드 패널 ─────────────────────────────── */
.scouter-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 300;
  opacity: 0; pointer-events: none;
  transition: opacity .28s;
}
.scouter-overlay.open { opacity: 1; pointer-events: all; }

.scouter-panel {
  position: fixed; top: 0; right: -380px;
  width: 360px; max-width: 96vw; height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: -6px 0 28px rgba(0,0,0,.35);
  z-index: 301;
  display: flex; flex-direction: column;
  transition: right .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.scouter-panel.open { right: 0; }

.scouter-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.scouter-panel-header span { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.scouter-close-btn {
  background: none; border: none; color: var(--text-2);
  cursor: pointer; font-size: 1.05rem; padding: 4px 6px; line-height: 1;
  border-radius: 5px; transition: background .15s;
}
.scouter-close-btn:hover { background: var(--bg-hover); color: var(--text); }

.scouter-char-section {
  display: flex; align-items: center; gap: 14px;
  padding: 18px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.scouter-char-img { width: 72px; height: 72px; object-fit: contain; flex-shrink: 0; }
.scouter-char-placeholder {
  width: 72px; height: 72px; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; background: var(--bg); border-radius: 8px; flex-shrink: 0;
}
.scouter-char-name { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.scouter-char-sub  { font-size: .78rem; color: var(--text-2); }

.scouter-stats-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }

.scouter-stat-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
}
.scouter-stat-card-label {
  font-size: .72rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-2); margin-bottom: 6px;
}
.scouter-stat-value {
  font-size: 1.5rem; font-weight: 700; color: var(--accent);
  letter-spacing: -.02em; line-height: 1.1;
}
.scouter-stat-value.loading {
  font-size: .82rem; font-weight: 400; color: var(--text-2);
  display: flex; align-items: center; gap: 7px;
}
.scouter-stat-value.error { font-size: .82rem; font-weight: 400; color: var(--danger); }

.scouter-link-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px; margin-top: 4px;
  background: var(--accent); color: #000;
  border-radius: 8px; font-size: .82rem; font-weight: 700;
  text-decoration: none; transition: opacity .15s;
}
.scouter-link-btn:hover { opacity: .82; }

.character-card { cursor: pointer; }

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
  .weekly-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 16px; }
  .weekly-grid { grid-template-columns: 1fr; }
  .character-grid { grid-template-columns: 1fr; }
  .add-char-form { flex-direction: column; align-items: stretch; }
  .diff-row, .diff-row-header { grid-template-columns: 1fr 80px 120px 28px; }
}
