﻿:root {
  --bg: #0f1419;
  --bg-soft: #161d26;
  --card: #1c2530;
  --card-2: #222d3a;
  --line: #2c3845;
  --text: #e8edf2;
  --muted: #8a98a8;
  --primary: #16c172;
  --primary-d: #0fa460;
  --accent: #ffd23f;
  --danger: #ff5d5d;
  --info: #4aa3ff;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select {
  font-family: inherit; font-size: 14px;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; min-height: 90px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }

/* ---------------- 레이아웃 ---------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px; flex-shrink: 0;
  background: linear-gradient(180deg, #11161d, #0d1218);
  border-right: 1px solid var(--line);
  padding: 22px 16px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--info));
  display: grid; place-items: center; font-weight: 800; color: #08130d; font-size: 20px;
}
.brand h1 { font-size: 18px; margin: 0; letter-spacing: .3px; }
.brand small { color: var(--muted); font-size: 11px; display: block; }

.nav { margin-top: 18px; display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: 10px; color: var(--muted);
  font-size: 14.5px; font-weight: 500; transition: .15s;
}
.nav a .ic { width: 20px; text-align: center; }
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.active { background: rgba(22,193,114,.14); color: var(--primary); font-weight: 700; }

.sidebar .me {
  margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.sidebar .me b { color: var(--text); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; background: rgba(15,20,25,.85);
  backdrop-filter: blur(8px); z-index: 20;
}
.topbar h2 { font-size: 18px; margin: 0; }
.topbar .actions { display: flex; gap: 8px; align-items: center; }
.topbar-left { display: flex; align-items: center; gap: 8px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.content { padding: 24px; max-width: 1100px; width: 100%; margin: 0 auto; }

/* 모바일 전용 요소 (데스크탑에서 숨김) */
.mobile-brand { display: none; align-items: center; gap: 8px; }
.mobile-brand .logo-sm {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--info));
  display: grid; place-items: center; font-weight: 800; color: #08130d; font-size: 14px;
}
.mobile-brand .mobile-title { font-size: 16px; font-weight: 800; letter-spacing: .2px; }
.mobile-theme-btn { display: none; }
.mobile-profile-wrap { display: none; position: relative; }
.mobile-profile-drop {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); z-index: 50; min-width: 130px; overflow: hidden;
}
.mobile-profile-drop.open { display: block; }
.drop-item {
  display: block; width: 100%; text-align: left; padding: 12px 16px;
  background: none; border: none; border-bottom: 1px solid var(--line);
  color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit;
}
.drop-item:last-child { border-bottom: none; }
.drop-item:hover { background: var(--card-2); }

/* ---------------- 버튼 ---------------- */
.btn {
  border: 1px solid var(--line); background: var(--card);
  color: var(--text); padding: 9px 15px; border-radius: 10px;
  font-size: 14px; font-weight: 600; transition: .15s; display: inline-flex;
  align-items: center; gap: 7px;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #062012; }
.btn.primary:hover { background: var(--primary-d); }
.btn.danger { background: transparent; border-color: rgba(255,93,93,.4); color: var(--danger); }
.btn.danger:hover { background: rgba(255,93,93,.1); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- 카드 ---------------- */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card.click { cursor: pointer; transition: .15s; }
.card.click:hover { transform: translateY(-2px); border-color: var(--primary); }
.card h3 { margin: 0 0 6px; font-size: 16.5px; }
.card .meta { color: var(--muted); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; }

.vote-card.past { opacity: .58; }
.vote-card.near { border-color: rgba(255,93,93,.55); box-shadow: 0 0 0 1px rgba(255,93,93,.25); }

/* ---------------- 뱃지/태그 ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--card-2); color: var(--muted); border: 1px solid var(--line);
}
.badge.green { background: rgba(22,193,114,.16); color: var(--primary); border-color: transparent; }
.badge.gold  { background: rgba(255,210,63,.16); color: var(--accent); border-color: transparent; }
.badge.blue  { background: rgba(74,163,255,.16); color: var(--info); border-color: transparent; }
.badge.red   { background: rgba(255,93,93,.16); color: var(--danger); border-color: transparent; }
.badge.gray  { background: var(--card-2); }

.chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); }
.role-tag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px; }
.role-감독 { background: rgba(255,210,63,.18); color: var(--accent); }
.role-회장 { background: rgba(255,93,93,.16); color: var(--danger); }
.role-총무 { background: rgba(74,163,255,.16); color: var(--info); }
.role-주장 { background: rgba(22,193,114,.16); color: var(--primary); }
.role-회원 { background: var(--card-2); color: var(--muted); }

/* ---------------- 섹션/제목 ---------------- */
.section-title { font-size: 15px; color: var(--muted); margin: 26px 0 12px; font-weight: 700; letter-spacing: .3px; }
.section-title:first-child { margin-top: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.page-head .desc { color: var(--muted); font-size: 13.5px; margin-top: 3px; }

.empty { text-align: center; color: var(--muted); padding: 50px 20px; border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------------- 공지 배너 ---------------- */
.notice-banner {
  background: linear-gradient(90deg, rgba(255,93,93,.16), rgba(255,210,63,.10));
  border: 1px solid rgba(255,93,93,.35); border-radius: 12px;
  padding: 13px 16px; margin-bottom: 18px; display: flex; gap: 12px; align-items: center;
}
.notice-banner .ic { font-size: 18px; }

/* ---------------- 테이블 ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12.5px; font-weight: 700; }
tr:hover td { background: rgba(255,255,255,.02); }
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--primary); }
.dot.no { background: var(--danger); }
.dot.none { background: var(--line); }

/* ---------------- 투표 응답 버튼 ---------------- */
.vote-actions { display: flex; gap: 8px; margin: 14px 0; }
.vote-actions .btn { flex: 1; justify-content: center; }
.vote-actions .btn.sel-yes { background: var(--primary); color: #062012; border-color: var(--primary); }
.vote-actions .btn.sel-maybe { background: var(--accent); color: #2a2200; border-color: var(--accent); }
.vote-actions .btn.sel-no { background: var(--danger); color: #2a0000; border-color: var(--danger); }
.respondents { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------------- 댓글 ---------------- */
.comment { padding: 11px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: none; }
.comment .who { font-weight: 700; font-size: 13.5px; }
.comment .when { color: var(--muted); font-size: 12px; margin-left: 8px; }
.comment p { margin: 5px 0 0; font-size: 14px; }

/* ---------------- 타임라인(회비) ---------------- */
.dues-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.dues-cell {
  min-width: 52px; text-align: center; font-size: 11.5px; padding: 6px 4px;
  border-radius: 7px; border: 1px solid var(--line);
}
.dues-cell.paid { background: rgba(22,193,114,.16); color: var(--primary); border-color: transparent; }
.dues-cell.unpaid { background: rgba(255,93,93,.12); color: var(--danger); border-color: transparent; }
.dues-cell.toggle { cursor: pointer; }

/* ---------------- 모달 ---------------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 100; overflow-y: auto; backdrop-filter: blur(3px);
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; width: 100%; max-width: 560px; box-shadow: var(--shadow);
}
.modal.lg { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px; }
.modal-foot { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.x { background: none; border: none; color: var(--muted); font-size: 22px; line-height: 1; }

/* ---------------- 로그인 ---------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--card);
  border: 1px solid var(--line); border-radius: 18px; padding: 34px 28px; box-shadow: var(--shadow);
}
.login-card .logo {
  width: 56px; height: 56px; border-radius: 15px; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--primary), var(--info));
  display: grid; place-items: center; font-weight: 800; color: #08130d; font-size: 26px;
}
.login-card h1 { text-align: center; font-size: 22px; margin: 0 0 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-card .err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }
.login-card .hint { margin-top: 18px; font-size: 12px; color: var(--muted); background: var(--bg-soft); padding: 10px 12px; border-radius: 10px; }

/* ---------------- 모바일 ---------------- */
.mobile-bar { display: none; }
@media (max-width: 860px) {
  .sidebar { display: none; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .topbar { padding: 0 12px; }
  #pageTitle { display: none; }
  .mobile-brand { display: flex; }
  .mobile-theme-btn { display: inline-flex; }
  .mobile-profile-wrap { display: flex; }
  .mobile-bar {
    display: flex; position: sticky; top: 62px; z-index: 15;
    background: var(--bg-soft); border-bottom: 1px solid var(--line);
    overflow-x: auto; gap: 4px; padding: 8px 12px;
  }
  .mobile-bar a {
    white-space: nowrap; padding: 8px 12px; border-radius: 8px;
    font-size: 13px; color: var(--muted); font-weight: 600;
  }
  .mobile-bar a.active { background: rgba(22,193,114,.14); color: var(--primary); }
}

.muted { color: var(--muted); }
.pre { white-space: pre-wrap; font-size: 14px; line-height: 1.7; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.flex { display: flex; gap: 8px; align-items: center; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 14px; } .mt-4 { margin-top: 20px; }
.stat { font-size: 26px; font-weight: 800; }
.stat-label { color: var(--muted); font-size: 12.5px; }

/* ---- 라이트 모드 ---- */
[data-theme="light"] {
  --bg: #f0f4f9;
  --bg-soft: #e5eaf2;
  --card: #ffffff;
  --card-2: #eef2f8;
  --line: #d0d9e8;
  --text: #1a2332;
  --muted: #6a7a8e;
  --shadow: 0 4px 16px rgba(30,60,100,.10);
}
[data-theme="light"] body { background: var(--bg); color: var(--text); }
[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, #e0e8f4, #d8e2f0);
  border-right-color: var(--line);
}
[data-theme="light"] .topbar {
  background: rgba(240,244,249,.92);
  border-bottom-color: var(--line);
}
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: var(--card); color: var(--text); border-color: var(--line);
}
[data-theme="light"] .modal-bg { background: rgba(0,0,0,.4); }
[data-theme="light"] .mobile-bar { background: var(--bg-soft); border-color: var(--line); }
[data-theme="light"] .mobile-profile-drop { background: var(--card); border-color: var(--line); }
[data-theme="light"] .drop-item { color: var(--text); border-color: var(--line); }
[data-theme="light"] .drop-item:hover { background: var(--card-2); }
[data-theme="light"] .notice-banner {
  background: linear-gradient(90deg, rgba(255,93,93,.10), rgba(255,210,63,.07));
}