@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=DM+Mono:ital,wght@0,400;0,500;1,400&display=swap');

:root {
  --bg: #f8f8ff;
  --surface: #ffffff;
  --surface2: #f2f2ff;
  --surface3: #eaeaff;
  --border: #d8d8f0;
  --accent: #5c6bc0;
  --accent-glow: rgba(92,107,192,0.15);
  --accent2: #e91e63;
  --accent3: #00c853;
  --warn: #ff9800;
  --admin: #ff6f00;
  --admin-glow: rgba(255,111,0,0.12);
  --text: #111128;
  --muted: #4a4a78;
  --rank1: #ffd600;
  --rank2: #90a4ae;
  --rank3: #ff7043;
  --danger: #f44336;
  --birthday: #e91e63;
  --anniversary: #ffd600;
  --milestone: #5c6bc0;
  --birthday-glow: rgba(233,30,99,0.12);
  --anniversary-glow: rgba(255,214,0,0.18);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% -10%, rgba(92,107,192,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 30% at 80% 110%, rgba(0,200,83,0.05) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}

/* ══════════════════════════════════════
   VIEWS — only one visible at a time
══════════════════════════════════════ */
.view { display: none; }
.view.active { display: block; }

/* ══════════════════════════════════════
   LOCK SCREEN
══════════════════════════════════════ */
#lockScreen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 900;
  flex-direction: column; gap: 0;
}

.lock-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px 44px;
  width: 380px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.lock-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--admin);
}

.lock-icon { font-size: 40px; margin-bottom: 14px; }
.lock-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.lock-sub { font-size: 12px; color: var(--muted); margin-bottom: 24px; line-height: 1.5; }

.pin-dots {
  display: flex; justify-content: center; gap: 12px;
  margin-bottom: 24px;
}

.pin-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: all 0.2s;
}

.pin-dot.filled { background: var(--admin); border-color: var(--admin); }

.pin-pad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 16px;
}

.pin-key {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 16px; font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: all 0.1s;
}

.pin-key:hover { background: var(--surface); border-color: var(--accent); }
.pin-key:active { transform: scale(0.95); }
.pin-key.wide { grid-column: span 2; }
.pin-key.clear { color: var(--muted); font-size: 13px; }

.lock-error {
  font-size: 12px; color: var(--danger);
  font-weight: 700; min-height: 18px;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.lock-back {
  margin-top: 16px;
  background: none; border: none;
  color: var(--muted); font-family: 'Inter', sans-serif;
  font-size: 12px; cursor: pointer;
  text-decoration: underline;
}
.lock-back:hover { color: var(--text); }

/* ══════════════════════════════════════
   SHARED HEADER
══════════════════════════════════════ */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 10;
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 24px; }
.logo-text { font-size: 19px; font-weight: 800; letter-spacing: -0.5px; }
.logo-text em { color: var(--accent); font-style: normal; }

.view-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px; margin-left: 8px;
}
.view-badge.user  { background: rgba(92,107,192,0.13); color: var(--accent); }
.view-badge.admin { background: rgba(255,159,67,0.18);  color: var(--admin); }

.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.channel-badge {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 11px;
  font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted);
}
.channel-badge::before { content: '# '; color: var(--accent); }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  border: none; cursor: pointer; font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 700; padding: 7px 15px;
  border-radius: 6px; transition: all 0.15s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-admin    { background: var(--admin); color: #000; }
.btn-admin:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-ghost    { background: var(--surface2); border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.85; }
.btn-sm { padding: 4px 10px; font-size: 11px; }

/* ══════════════════════════════════════
   PILL GROUPS
══════════════════════════════════════ */
.pill-group {
  display: flex; gap: 3px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 3px;
}
.pill {
  background: none; border: none; color: var(--muted);
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700;
  padding: 4px 11px; border-radius: 5px;
  cursor: pointer; transition: all 0.15s; letter-spacing: 0.5px; white-space: nowrap;
}
.pill.active { background: var(--accent); color: #fff; }
.pill.active-admin { background: var(--admin); color: #000; }
.pill:hover:not(.active):not(.active-admin) { color: var(--text); }

/* ══════════════════════════════════════
   STATS BAR
══════════════════════════════════════ */
.stats-bar {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 1px; background: var(--border);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 5;
}
.stat-cell { background: var(--surface); padding: 16px 22px; display: flex; flex-direction: column; gap: 3px; }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.stat-label { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
.sv-purple { color: var(--accent); }
.sv-mint   { color: var(--accent3); }
.sv-pink   { color: var(--accent2); }
.sv-gold   { color: var(--rank1); }
.sv-warn   { color: var(--warn); }

/* ══════════════════════════════════════
   MY STATS BANNER
══════════════════════════════════════ */
.my-banner {
  background: linear-gradient(135deg, var(--surface2) 0%, rgba(92,107,192,0.08) 100%);
  border: 1px solid var(--accent); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 20px;
  display: grid; grid-template-columns: 1fr auto auto auto auto;
  align-items: center; gap: 20px;
  box-shadow: 0 0 20px var(--accent-glow);
}
.my-banner-name { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.you-tag { font-size: 10px; font-weight: 700; background: var(--accent); color: #fff; padding: 2px 7px; border-radius: 20px; letter-spacing: 0.5px; }
.my-stat-blk { text-align: center; }
.my-stat-val { font-size: 24px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.my-stat-lbl { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }
.limit-sub { font-size: 11px; color: var(--muted); font-family: 'DM Mono', monospace; margin-top: 4px; }
.limit-sub.warn  { color: var(--warn); }
.limit-sub.maxed { color: var(--danger); font-weight: 700; }
.limit-mini-bar { height: 3px; background: var(--border); border-radius: 2px; margin-top: 4px; overflow: hidden; width: 80px; }
.limit-mini-fill { height: 100%; border-radius: 2px; background: var(--accent3); transition: width 0.5s ease; }
.limit-mini-fill.warn  { background: var(--warn); }
.limit-mini-fill.maxed { background: var(--danger); }

/* ══════════════════════════════════════
   MAIN LAYOUT
══════════════════════════════════════ */
.main-layout {
  display: grid; grid-template-columns: 1fr 290px;
  gap: 26px; padding: 26px 32px;
  max-width: 1280px; margin: 0 auto; position: relative; z-index: 5;
}

/* ══════════════════════════════════════
   SECTION TITLE
══════════════════════════════════════ */
.section-title {
  font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ══════════════════════════════════════
   LEADERBOARD CARDS
══════════════════════════════════════ */
.sort-tabs { display: flex; gap: 3px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 3px; margin-bottom: 14px; width: fit-content; }

.lb-grid { display: flex; flex-direction: column; gap: 7px; }

.lb-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 13px 17px;
  display: grid; grid-template-columns: 44px 1fr 170px 80px;
  align-items: center; gap: 13px;
  transition: all 0.2s; animation: slideIn 0.35s ease both;
}
.lb-card:hover { border-color: var(--accent); transform: translateX(3px); }
.lb-card.is-me { border-color: var(--accent); box-shadow: 0 0 14px var(--accent-glow); }
.lb-card.rank-1 { border-left: 3px solid var(--rank1); }
.lb-card.rank-2 { border-left: 3px solid var(--rank2); }
.lb-card.rank-3 { border-left: 3px solid var(--rank3); }

@keyframes slideIn { from { opacity:0; transform:translateX(-12px); } to { opacity:1; transform:translateX(0); } }

.rank-num { font-size: 19px; font-weight: 800; text-align: center; color: var(--muted); font-family: 'DM Mono', monospace; }
.rank-1 .rank-num { color: var(--rank1); }
.rank-2 .rank-num { color: var(--rank2); }
.rank-3 .rank-num { color: var(--rank3); }

.person-info { display: flex; flex-direction: column; gap: 2px; }
.person-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.me-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.person-meta { font-size: 11px; color: var(--muted); font-family: 'DM Mono', monospace; }

.dual-bars { display: flex; flex-direction: column; gap: 5px; }
.bar-row { display: flex; align-items: center; gap: 8px; }
.bar-lbl { font-size: 9px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted); width: 34px; }
.bar-track { flex: 1; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 2px; transition: width 0.7s cubic-bezier(0.34,1.56,0.64,1); }
.bf-sent { background: var(--accent3); }
.bf-recv { background: var(--accent2); }
.bar-val { font-size: 11px; font-family: 'DM Mono', monospace; min-width: 18px; text-align: right; }

.count-col { text-align: right; }
.count-big { font-size: 24px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.cb-total { color: var(--accent); }
.cb-sent  { color: var(--accent3); }
.cb-recv  { color: var(--accent2); }
.count-lbl { font-size: 9px; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; }

/* ══════════════════════════════════════
   PANEL CARDS (right col)
══════════════════════════════════════ */
.right-panel { display: flex; flex-direction: column; gap: 20px; }

.panel-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }

.puzzle-big-num { text-align: center; padding: 6px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.puzzle-icon { font-size: 40px; }
.puzzle-count { font-size: 36px; font-weight: 800; color: var(--accent); letter-spacing: -2px; }
.puzzle-lbl { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }

.activity-feed { max-height: 260px; overflow-y: auto; }
.activity-feed::-webkit-scrollbar { width: 3px; }
.activity-feed::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.act-item { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--border); animation: fadeUp 0.3s ease both; }
.act-item:last-child { border-bottom: none; }
@keyframes fadeUp { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:translateY(0); } }
.act-icon { font-size: 15px; margin-top: 1px; }
.act-body { flex: 1; font-size: 11px; line-height: 1.5; color: var(--muted); }
.act-body strong { color: var(--text); }
.act-recv { color: var(--accent2); font-weight: 700; }
.act-time { font-size: 10px; color: var(--muted); font-family: 'DM Mono', monospace; white-space: nowrap; }

/* ══════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════ */
.empty-state { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty-emoji { font-size: 40px; margin-bottom: 10px; }
.empty-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-sub { font-size: 12px; line-height: 1.6; }

/* ══════════════════════════════════════
   ADMIN VIEW — two-column config layout
══════════════════════════════════════ */
.admin-header-bar {
  background: linear-gradient(90deg, rgba(255,159,67,0.08) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255,159,67,0.2);
  padding: 10px 32px;
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--admin); font-weight: 700; letter-spacing: 0.5px;
}

.admin-layout {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 22px; padding: 26px 32px;
  max-width: 1280px; margin: 0 auto; position: relative; z-index: 5;
}

.admin-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px;
}

.admin-card.full { grid-column: 1 / -1; }

.admin-card-title {
  font-size: 13px; font-weight: 800; margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}

.admin-card-sub { font-size: 11px; color: var(--muted); margin-bottom: 18px; line-height: 1.5; }

.admin-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 2px 7px; border-radius: 20px; background: rgba(255,159,67,0.15); color: var(--admin);
}

/* ══════════════════════════════════════
   FORM ELEMENTS
══════════════════════════════════════ */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.form-input, .form-textarea, .form-select {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text);
  font-family: 'DM Mono', monospace; font-size: 13px;
  padding: 9px 12px; outline: none; transition: border-color 0.15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--accent); }
.form-textarea { min-height: 90px; resize: vertical; }
.form-select { appearance: none; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.input-row { display: flex; gap: 8px; }
.input-row .form-input { flex: 1; }

/* ══════════════════════════════════════
   TOGGLE SWITCH
══════════════════════════════════════ */
.toggle-wrap { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.toggle-label { font-size: 13px; font-weight: 700; }
.toggle-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.toggle-btn {
  position: relative; width: 40px; height: 22px;
  background: var(--border); border-radius: 11px;
  border: none; cursor: pointer; transition: background 0.2s; flex-shrink: 0;
}
.toggle-btn.on { background: var(--accent); }
.toggle-btn::after {
  content: ''; position: absolute;
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  top: 3px; left: 3px; transition: left 0.2s;
}
.toggle-btn.on::after { left: 21px; }

/* ══════════════════════════════════════
   MEMBER LIST (admin)
══════════════════════════════════════ */
.member-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; }
.member-list::-webkit-scrollbar { width: 3px; }
.member-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.member-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px;
  animation: fadeUp 0.2s ease both;
}
.member-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: var(--accent); flex-shrink: 0;
}
.member-name { flex: 1; font-size: 13px; font-weight: 700; }
.member-meta { font-size: 10px; color: var(--muted); font-family: 'DM Mono', monospace; }
.member-stats { font-size: 11px; color: var(--muted); font-family: 'DM Mono', monospace; text-align: right; }

/* ══════════════════════════════════════
   LOG MODAL (user)
══════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 14px; padding: 26px;
  width: 480px; max-width: 92vw; max-height: 90vh; overflow-y: auto;
  transform: translateY(14px); transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-title { font-size: 16px; font-weight: 800; margin-bottom: 5px; }
.modal-sub { font-size: 12px; color: var(--muted); margin-bottom: 18px; line-height: 1.5; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

.mode-tabs { display: flex; gap: 3px; margin-bottom: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.mode-tab { flex: 1; background: none; border: none; color: var(--muted); font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700; padding: 6px; border-radius: 5px; cursor: pointer; transition: all 0.15s; text-align: center; }
.mode-tab.active { background: var(--surface3); color: var(--text); }

.info-box { background: rgba(92,107,192,0.07); border: 1px solid rgba(92,107,192,0.20); border-radius: 6px; padding: 10px 13px; font-size: 11px; color: var(--muted); line-height: 1.5; margin-bottom: 14px; }
.info-box strong { color: var(--text); }

.warn-box { background: rgba(255,77,109,0.08); border: 1px solid rgba(255,77,109,0.25); border-radius: 6px; padding: 10px 13px; font-size: 11px; color: var(--danger); font-weight: 700; margin-bottom: 12px; display: none; }
.warn-box.show { display: block; }

/* ══════════════════════════════════════
   USER IDENTITY MODAL
══════════════════════════════════════ */
.identity-select {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 300px; overflow-y: auto;
}
.identity-option {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface3); border: 1px solid var(--border);
  border-radius: 8px; padding: 11px 14px; cursor: pointer;
  transition: all 0.15s;
}
.identity-option:hover { border-color: var(--accent); background: rgba(92,107,192,0.07); }
.identity-option.selected { border-color: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.id-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: var(--accent); flex-shrink: 0; }
.id-name { font-size: 13px; font-weight: 700; }
.id-meta { font-size: 11px; color: var(--muted); }

/* ══════════════════════════════════════
   CONFIRM DIALOG
══════════════════════════════════════ */
.confirm-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px);
  z-index: 800; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.confirm-overlay.open { opacity: 1; pointer-events: all; }
.confirm-box {
  background: var(--surface2); border: 1px solid var(--danger);
  border-radius: 14px; padding: 28px 32px; width: 360px; text-align: center;
}
.confirm-icon { font-size: 36px; margin-bottom: 12px; }
.confirm-title { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.confirm-msg { font-size: 12px; color: var(--muted); margin-bottom: 22px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* ══════════════════════════════════════
   UTILITY
══════════════════════════════════════ */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 11px; }
.mono { font-family: 'DM Mono', monospace; }
.flex-row { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.2); border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.drawer-entries-scroll {
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.drawer-entries-scroll::-webkit-scrollbar { width: 3px; }
.drawer-entries-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ══════════════════════════════════════
   MILESTONE NOTIFICATIONS
══════════════════════════════════════ */
.milestone-section { margin-bottom: 24px; }

.milestone-row {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px;
}

.milestone-card {
  border-radius: 8px; padding: 8px 12px;
  display: flex; align-items: center; gap: 10px;
  animation: slideIn 0.4s ease both;
  border: 1px solid;
  position: relative; overflow: hidden;
}

.milestone-card::before {
  content: ''; position: absolute; inset: 0;
  opacity: 0.06; pointer-events: none;
}

.milestone-card.birthday {
  background: linear-gradient(135deg, rgba(255,107,157,0.12) 0%, var(--surface) 100%);
  border-color: rgba(255,107,157,0.4);
}

.milestone-card.anniversary {
  background: linear-gradient(135deg, rgba(245,200,66,0.1) 0%, var(--surface) 100%);
  border-color: rgba(245,200,66,0.35);
}

.milestone-card.milestone-year {
  background: linear-gradient(135deg, rgba(92,107,192,0.10) 0%, var(--surface) 100%);
  border-color: rgba(92,107,192,0.35);
  box-shadow: 0 0 20px rgba(92,107,192,0.10);
}

.milestone-card.upcoming {
  opacity: 0.75;
  border-style: dashed;
}

.milestone-icon { font-size: 20px; flex-shrink: 0; line-height: 1; }

.milestone-body { flex: 1; }
.milestone-name { font-size: 13px; font-weight: 800; }
.milestone-desc { font-size: 11px; color: var(--muted); margin-top: 1px; line-height: 1.3; }

.milestone-badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
  white-space: nowrap; flex-shrink: 0;
}
.milestone-badge.birthday-badge   { background: rgba(255,107,157,0.18); color: var(--birthday); }
.milestone-badge.anniversary-badge { background: rgba(245,200,66,0.15); color: var(--anniversary); }
.milestone-badge.milestone-badge-yr { background: rgba(92,107,192,0.13); color: var(--milestone); }

.milestone-bonus {
  font-size: 11px; font-weight: 800; text-align: right; white-space: nowrap; flex-shrink: 0;
}
.milestone-bonus .bonus-num { font-size: 14px; letter-spacing: -0.5px; }

.milestone-days-away {
  font-size: 10px; font-weight: 700; color: var(--muted);
  letter-spacing: 0.5px; text-align: right; flex-shrink: 0;
}

.ms-today-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--birthday); margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.ms-today-label::after { content: ''; flex:1; height:1px; background: rgba(255,107,157,0.25); }
.ms-upcoming-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); margin: 12px 0 6px;
  display: flex; align-items: center; gap: 8px;
}
.ms-upcoming-label::after { content: ''; flex:1; height:1px; background: var(--border); }

/* ══════════════════════════════════════
   PROFILE DRAWER (user — own card only)
══════════════════════════════════════ */
.lb-card { cursor: default; }
.lb-card.is-me { cursor: pointer; }

.lb-card .profile-drawer {
  display: none;
  width: 100%;
  flex-basis: 100%;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  animation: fadeUp 0.2s ease both;
}

.lb-card.expanded .profile-drawer { display: block; }

.lb-card.is-me .expand-hint {
  font-size: 10px; font-weight: 700; color: var(--accent);
  letter-spacing: 0.5px; opacity: 0.7;
  margin-left: auto; white-space: nowrap;
  transition: opacity 0.15s;
}
.lb-card.is-me:hover .expand-hint { opacity: 1; }
.lb-card.expanded .expand-hint { opacity: 1; }

.drawer-tabs {
  display: flex; gap: 3px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px; padding: 3px;
  width: fit-content; margin-bottom: 12px;
}
.drawer-tab {
  background: none; border: none;
  color: var(--muted); font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 700;
  padding: 4px 12px; border-radius: 5px;
  cursor: pointer; transition: all 0.15s;
}
.drawer-tab.active { background: var(--surface3); color: var(--text); }

.drawer-entry {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.drawer-entry:last-child { border-bottom: none; }

.drawer-pip {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px;
}
.drawer-pip.sent { background: var(--accent3); }
.drawer-pip.recv { background: var(--accent2); }

.drawer-body { flex: 1; }
.drawer-who { font-size: 12px; font-weight: 700; }
.drawer-note { font-size: 11px; color: var(--muted); font-style: italic; margin-top: 1px; }

.drawer-right { text-align: right; flex-shrink: 0; }
.drawer-count { font-size: 15px; font-weight: 800; font-family: "DM Mono", monospace; }
.drawer-count.sent { color: var(--accent3); }
.drawer-count.recv { color: var(--accent2); }
.drawer-date { font-size: 10px; color: var(--muted); font-family: "DM Mono", monospace; }

.drawer-empty { text-align: center; padding: 14px; color: var(--muted); font-size: 12px; }

/* ══════════════════════════════════════
   ADMIN RECORDS MODAL
══════════════════════════════════════ */
.records-table { width: 100%; border-collapse: collapse; }
.records-table th {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted);
  padding: 6px 10px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.records-table td {
  padding: 9px 10px; border-bottom: 1px solid var(--border);
  font-size: 12px; vertical-align: middle;
}
.records-table tr:last-child td { border-bottom: none; }
.records-table tr:hover td { background: var(--surface2); }

.records-scroll {
  max-height: 420px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px;
}
.records-scroll::-webkit-scrollbar { width: 3px; }
.records-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.inline-edit-input {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text);
  font-family: "DM Mono", monospace; font-size: 11px;
  padding: 4px 7px; width: 100%; outline: none;
}
.inline-edit-input:focus { border-color: var(--accent); }

.pill-type {
  font-size: 9px; font-weight: 700; letter-spacing: 0.5px;
  padding: 2px 7px; border-radius: 20px; white-space: nowrap;
}
.pill-type.sent { background: rgba(67,232,176,0.12); color: var(--accent3); }
.pill-type.recv { background: rgba(255,107,157,0.12); color: var(--accent2); }
.pill-type.bonus { background: rgba(92,107,192,0.10); color: var(--accent); }


/* ══════════════════════════════════════
   FILE IMPORT MODAL
══════════════════════════════════════ */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--admin);
  background: rgba(255,159,67,0.04);
}
.drop-zone-icon { font-size: 32px; margin-bottom: 8px; }
.drop-zone-text { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.drop-zone-sub  { font-size: 11px; color: var(--muted); }

.column-mapper {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.mapper-arrow { color: var(--muted); font-size: 14px; text-align: center; }

.preview-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.preview-table th {
  font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left;
}
.preview-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); }
.preview-table tr:last-child td { border-bottom: none; }
.preview-scroll { max-height: 160px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; }
.preview-scroll::-webkit-scrollbar { width: 3px; }
.preview-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.import-step {
  background: var(--surface3); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 10px;
}
.import-step-title { font-size: 12px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.step-num {
  width: 20px; height: 20px; border-radius: 50%; background: var(--admin);
  color: #000; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}


/* ══════════════════════════════════════
   ADMIN TABS
══════════════════════════════════════ */
.admin-tabs-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255,159,67,0.2);
  padding: 0 32px;
  background: rgba(255,159,67,0.03);
  position: relative; z-index: 5;
}

.admin-tab-btn {
  background: none; border: none;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700;
  color: var(--muted); padding: 14px 22px;
  cursor: pointer; transition: all 0.15s;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: 0.3px;
}
.admin-tab-btn:hover { color: var(--text); }
.admin-tab-btn.active { color: var(--admin); border-bottom-color: var(--admin); }

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

.admin-summary-bar {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 1px; background: var(--border);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 5;
}

.member-search-wrap {
  position: relative; margin-bottom: 12px;
}
.member-search-wrap input {
  padding-left: 34px;
}
.member-search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 14px; pointer-events: none;
}


/* ══════════════════════════════════════
   PERIOD PICKER POPOVER
══════════════════════════════════════ */
.period-popover-wrap { position: relative; display: inline-flex; }

.period-popover {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  z-index: 200; min-width: 240px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: fadeUp 0.15s ease both;
  display: none;
}
.period-popover.open { display: block; }

.popover-title {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}

.popover-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 6px; }

.popover-item {
  background: var(--surface3); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px;
  font-size: 12px; font-weight: 700; color: var(--text);
  cursor: pointer; transition: all 0.12s; text-align: center;
  font-family: 'Inter', sans-serif; border: none;
}
.popover-item:hover { background: var(--surface); border: 1px solid var(--accent); }
.popover-item.active { background: var(--accent); color: #fff; border: 1px solid var(--accent); }

.year-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.year-nav-btn {
  background: var(--surface3); border: none; color: var(--text);
  font-size: 14px; cursor: pointer; padding: 2px 8px; border-radius: 4px;
  transition: background 0.12s;
}
.year-nav-btn:hover { background: var(--surface); }
.year-label { font-size: 13px; font-weight: 700; }
