@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css');

:root {
  --bg: #0a0d14;
  --surface: #10141e;
  --surface-2: #151b27;
  --line: #1f2635;
  --line-strong: #2a3345;
  --text: #eef1f7;
  --text-dim: #8b94a7;
  --accent: #2663eb;
  --radius: 20px;

  --confirmed: #f87171;
  --confirmed-bg: rgba(239, 68, 68, 0.16);
  --pending: #facc15;
  --pending-bg: rgba(250, 204, 21, 0.2);
  --tbd: #9aa3b5;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: 'Pretendard Variable', Pretendard, system-ui, -apple-system, sans-serif;
  font-size: 20px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 0% -10%, rgba(38, 99, 235, 0.16), transparent 60%),
    radial-gradient(700px 420px at 100% 0%, rgba(124, 58, 237, 0.1), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.bg { display: none; }

.card, .glass {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ── 헤더 ── */
header.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px max(24px, calc((100% - 1440px) / 2));
  background: rgba(10, 13, 20, 0.72);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: none; border-bottom: 1px solid var(--line); border-radius: 0;
}
.brand { display: flex; align-items: center; gap: 14px; font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 20px; font-weight: 800;
}
.brand small {
  font-weight: 500; font-size: 20px; color: var(--text-dim);
  padding-left: 14px; border-left: 1px solid var(--line-strong);
}
.user { display: flex; align-items: center; gap: 12px; }
.user img, .user .ph { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-strong); display: grid; place-items: center; font-weight: 700; }

main { flex: 1; width: min(1440px, calc(100% - 48px)); margin: 32px auto; }

/* ── 버튼 ── */
.btn {
  font: inherit; font-size: 20px; color: var(--text); cursor: pointer;
  padding: 11px 20px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  transition: background 0.15s, border-color 0.15s; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; white-space: nowrap;
}
.btn:hover { background: #1c2331; border-color: #36405a; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #3a73f0; }
.btn.danger { background: transparent; border-color: rgba(248, 113, 113, 0.5); color: #fca5a5; }
.btn.danger:hover { background: rgba(239, 68, 68, 0.12); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.icon { width: 48px; padding: 10px 0; font-size: 24px; line-height: 1; }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; font-weight: 600; padding: 16px 30px; font-size: 22px; }
.btn.discord:hover { background: #6a75f4; }

.nav-group { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; }
.nav-group .btn { border: none; border-radius: 0; background: var(--surface-2); }
.nav-group .btn + .btn { border-left: 1px solid var(--line-strong); }

/* ── 로그인 ── */
.center { min-height: 62vh; display: grid; place-items: center; }
.login-card { width: min(560px, 100%); padding: 56px 48px; text-align: center; }
.login-card h1 { margin: 0 0 12px; font-size: 34px; letter-spacing: -0.02em; }
.login-card p { margin: 0 0 36px; color: var(--text-dim); }
.notice { margin-top: 24px; padding: 14px 18px; border-radius: 14px; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(248, 113, 113, 0.4); color: #fecaca; }

/* ── 레이아웃 ── */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.panel { padding: 28px; }
.side { display: flex; flex-direction: column; gap: 24px; padding: 0; background: none; border: none; }
.side > .card { padding: 28px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.toolbar .nav { display: flex; align-items: center; gap: 16px; }
.toolbar h2 { margin: 0; font-size: 32px; letter-spacing: -0.02em; min-width: 200px; }
.toolbar .right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

select, input, textarea {
  font: inherit; font-size: 20px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 12px 16px; outline: none; width: 100%;
}
select { width: auto; background: var(--surface-2); cursor: pointer; }
select option { color: #111; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(38, 99, 235, 0.22); }
input[type='date'], input[type='time'] { color-scheme: dark; }
textarea { resize: vertical; min-height: 96px; }

/* ── 상태 요약 (범례 + 개수) ── */
.summary { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.summary span {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-dim);
}
.summary b { color: var(--text); font-weight: 700; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; flex: none; }
.sw.confirmed { background: var(--confirmed-bg); box-shadow: inset 0 0 0 2px var(--confirmed); }
.sw.pending { background: var(--pending); }
.sw.tbd { background: transparent; border: 2px dashed var(--tbd); }

/* ── 캘린더 ── */
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-bottom: 8px; }
.cal-head div { text-align: left; padding: 0 12px; color: var(--text-dim); font-weight: 600; }
.cal-head .sun { color: #f19c9c; }
.cal-head .sat { color: #8fb4f7; }

.cal {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.day {
  min-height: 136px; padding: 10px 10px 12px; background: var(--surface);
  display: flex; flex-direction: column; gap: 6px; min-width: 0; transition: background 0.12s;
}
.day.clickable { cursor: pointer; }
.day.clickable:hover { background: var(--surface-2); }
.day.other { background: #0d1119; }
.day.other .num { color: #4a5368; }
.day .num { font-weight: 600; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; flex: none; margin: -2px 0 2px -2px; }
.day.sun .num { color: #f19c9c; }
.day.sat .num { color: #8fb4f7; }
.day.today .num { background: var(--accent); color: #fff; }

.ev {
  font-size: 20px; line-height: 1.35; padding: 3px 10px; border-radius: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; min-width: 0;
  border-left: 4px solid transparent;
}
.ev.confirmed { background: var(--confirmed-bg); border-left-color: var(--confirmed); color: #fde2e2; }
.ev.pending { background: var(--pending-bg); border-left-color: var(--pending); color: #fef3c7; }
.ev.tbd { background: transparent; border: 1.5px dashed #4b556b; border-left: 4px dashed var(--tbd); color: var(--text-dim); }
.ev:hover { filter: brightness(1.2); }
.more { font-size: 20px; color: var(--text-dim); padding-left: 8px; }
.dots { display: none; gap: 5px; flex-wrap: wrap; justify-content: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.confirmed { background: var(--confirmed); }
.dot.pending { background: var(--pending); }
.dot.tbd { border: 1.5px dashed var(--tbd); }

/* ── 다음 일정 카드 ── */
.next .next-head { color: var(--text-dim); margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.dday { font-weight: 700; color: #fff; background: var(--accent); padding: 4px 14px; border-radius: 999px; }
.next .t { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.next .m { color: var(--text-dim); }
.next .status-line { margin-top: 16px; display: flex; align-items: center; gap: 10px; }

/* ── 사이드 리스트 ── */
.side h3 { margin: 0 0 20px; font-size: 24px; letter-spacing: -0.01em; }
.list { display: flex; flex-direction: column; gap: 22px; }
.group-title { color: var(--text-dim); font-weight: 600; margin-bottom: 10px; }
.group-title.today { color: #8fb4f7; }
.group-items { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: start;
  padding: 14px 16px; border-radius: 14px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line);
  border-left: 4px solid var(--tbd); transition: border-color 0.12s, background 0.12s;
}
.item:hover { background: #1a2130; }
.item.confirmed { border-left-color: var(--confirmed); }
.item.pending { border-left-color: var(--pending); }
.item.tbd { border-left-style: dashed; }
.item .time { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.item .t { font-weight: 600; line-height: 1.35; }
.item .m { color: var(--text-dim); }
.empty { color: var(--text-dim); padding: 28px 6px; text-align: center; }
.hint { color: var(--text-dim); margin: -10px 0 20px; }

/* ── 모달 ── */
.backdrop { position: fixed; inset: 0; background: rgba(4, 6, 12, 0.7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.backdrop.open { display: flex; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 32px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.modal .title-input { font-size: 28px; font-weight: 700; border: none; border-bottom: 2px solid var(--line-strong); border-radius: 0; background: transparent; padding: 8px 2px; margin-bottom: 26px; }
.modal .title-input:focus { box-shadow: none; border-bottom-color: var(--accent); }
.row { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.row > .ico { width: 32px; flex: none; text-align: center; color: var(--text-dim); }
.row .grow { flex: 1; min-width: 0; }
.row .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; flex: 1; }
.seg button { font: inherit; font-size: 20px; color: var(--text-dim); padding: 12px; border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--bg); border: 1px solid var(--line-strong); }
.seg button.on { color: var(--text); background: var(--surface-2); border-color: #5b6680; box-shadow: inset 0 0 0 1px #5b6680; }
.label { color: var(--text-dim); margin: -4px 0 16px 44px; }
.actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.actions .r { display: flex; gap: 12px; margin-left: auto; }
.err { color: #fca5a5; margin-left: 44px; min-height: 30px; }

.detail h3 { margin: 0 0 6px; font-size: 28px; }
.detail .meta { display: grid; gap: 14px; margin: 24px 0 0; }
.detail .meta div { display: flex; gap: 16px; }
.detail .meta .k { color: var(--text-dim); width: 64px; flex: none; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px; border-radius: 999px; font-weight: 600; }
.badge.confirmed { background: var(--confirmed-bg); color: #fecaca; }
.badge.pending { background: var(--pending-bg); color: #fde68a; }
.badge.tbd { border: 1.5px dashed var(--tbd); color: var(--text-dim); }

/* ── 푸터 ── */
footer {
  width: min(1440px, calc(100% - 48px)); margin: 0 auto 32px; padding: 22px 0 0;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--text-dim); flex-wrap: wrap;
  background: none; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0;
}
footer .links { display: flex; gap: 10px; flex-wrap: wrap; }
footer a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); }
footer a:hover { background: var(--surface-2); }

.toast { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; padding: 14px 24px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-strong); transition: all 0.25s; z-index: 60; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.hidden { display: none !important; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 760px) {
  main, footer { width: calc(100% - 24px); }
  main { margin-top: 16px; }
  header.top { padding: 12px 14px; }
  .brand { font-size: 20px; gap: 10px; }
  .brand small, .user .uname { display: none; }
  .brand .logo { width: 36px; height: 36px; }
  .user { gap: 8px; }
  .user img, .user .ph { width: 36px; height: 36px; }
  .user .btn { padding: 8px 12px; }
  .panel { padding: 16px; }
  .side { grid-template-columns: 1fr; }
  .side > .card { padding: 20px; }
  .toolbar h2 { font-size: 26px; min-width: 0; }
  .cal-head div { text-align: center; padding: 0; }
  .day { min-height: 68px; padding: 6px 2px; align-items: center; }
  .day .num { width: 32px; height: 32px; margin: 0; }
  .day .ev, .day .more { display: none; }
  .day .dots { display: flex; }
  .modal { padding: 22px; }
  .row .pair { grid-template-columns: 1fr; }
  .label, .err { margin-left: 0; }
  .row > .ico { display: none; }
  .item { grid-template-columns: 64px 1fr; }
}
