/* =========================================================================
   PLANIX 행사관리 — 공용 스타일
   토큰 → 기본 요소 → 레이아웃(앱바·페이지) → 컴포넌트 → 페이지별
   ========================================================================= */

/* ---------- 글꼴 ---------- */
@font-face {
  font-family: "Pretendard";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/web/Pretendard-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Pretendard";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/web/Pretendard-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Pretendard";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/web/Pretendard-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Pretendard";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/web/Pretendard-Bold.woff2") format("woff2");
}

/* ---------- 토큰 ---------- */
:root {
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", "맑은 고딕", "Segoe UI", "Noto Sans KR", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "D2Coding", Consolas, "Courier New", monospace;

  /* 글자 크기 */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-base: 15px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 22px;
  --fs-3xl: 28px;

  /* 간격 (4px 단위) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;

  /* 모서리·그림자 */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, 0.16), 0 2px 6px rgba(16, 24, 40, 0.08);

  /* 색 — 중립 */
  --c-bg: #f4f6f9;
  --c-surface: #ffffff;
  --c-surface-2: #f8fafc;
  --c-surface-3: #eef2f6;
  --c-border: #e2e7ee;
  --c-border-strong: #cbd3dd;
  --c-text: #111827;
  --c-text-2: #3f4a5a;
  --c-text-3: #5f6b7a;
  --c-text-4: #8a94a3;

  /* 색 — 브랜드 */
  --c-brand: #1e3a8a;
  --c-primary: #2457d6;
  --c-primary-hover: #1d47b3;
  --c-primary-soft: #eaf0fd;
  --c-primary-line: #b9cbf5;
  --c-focus: rgba(36, 87, 214, 0.35);

  /* 색 — 상태 */
  --c-success: #157347;
  --c-success-soft: #e6f4ec;
  --c-warn: #8a4b06;
  --c-warn-soft: #fdf1dc;
  --c-warn-line: #f0cf95;
  --c-danger: #b42318;
  --c-danger-hover: #93200f;
  --c-danger-soft: #fdecea;
  --c-danger-line: #f3b8b1;
  --c-info: #3730a3;
  --c-info-soft: #eceafd;

  /* 상태 색: 가등록(점선·옅게) */
  --st-tentative-fg: #6b7584;
  --st-tentative-bg: #f7f8fa;
  --st-tentative-line: #b3bbc7;

  /* 컨트롤 높이 */
  --ctl-h: 36px;
  --ctl-h-sm: 30px;
  --touch: 44px;

  --appbar-h: 56px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (pointer: coarse), (max-width: 1023px) {
  :root {
    --ctl-h: 44px;
    --ctl-h-sm: 36px;
  }
}

/* ---------- 기본 요소 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
  margin: 0;
}
ul, ol {
  padding: 0;
  list-style: none;
}
a {
  color: var(--c-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
img, svg {
  display: block;
}
[hidden] {
  display: none !important;
}
table {
  border-collapse: collapse;
  width: 100%;
}
.num,
.tabular {
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: 100;
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}
.skip-link:focus {
  top: var(--sp-2);
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}
.icon--sm {
  width: 16px;
  height: 16px;
}
.icon--xs {
  width: 14px;
  height: 14px;
}
.icon--lg {
  width: 22px;
  height: 22px;
}

/* ---------- 앱 셸 ---------- */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--appbar-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}
.appbar__inner {
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--c-text);
  font-weight: 700;
  font-size: var(--fs-lg);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover {
  text-decoration: none;
}
.brand__mark {
  width: 28px;
  height: 28px;
}
.brand__sub {
  color: var(--c-text-3);
  font-weight: 500;
}

.appbar__nav {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex: 1;
}
.appbar__link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 36px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-md);
  color: var(--c-text-2);
  font-weight: 500;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.appbar__link:hover {
  background: var(--c-surface-3);
  color: var(--c-text);
  text-decoration: none;
}
.appbar__link.is-active {
  color: var(--c-primary);
  background: var(--c-primary-soft);
}

.appbar__user {
  margin-left: auto;
  display: flex;
  align-items: center;
}
.user-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 36px;
  padding: 0 var(--sp-2) 0 var(--sp-1);
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--c-text-2);
}
.user-btn:hover {
  background: var(--c-surface-3);
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.user-btn__name {
  font-weight: 500;
}
.role-tag {
  font-size: var(--fs-xs);
  color: var(--c-text-3);
}

.appbar__toggle {
  display: none;
}

@media (max-width: 767px) {
  .appbar__inner {
    gap: var(--sp-2);
    padding: 0 var(--sp-2) 0 var(--sp-4);
  }
  .appbar__toggle {
    display: inline-grid;
    place-items: center;
    margin-left: auto;
    width: var(--touch);
    height: var(--touch);
    border: 0;
    border-radius: var(--r-md);
    background: transparent;
    color: var(--c-text-2);
  }
  .appbar__nav {
    position: absolute;
    top: var(--appbar-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sp-2) var(--sp-2) var(--sp-3);
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-md);
    display: none;
  }
  .appbar__nav.is-open {
    display: flex;
  }
  .appbar__link {
    height: var(--touch);
  }
  .appbar__user {
    display: none;
  }
  .appbar__nav .appbar__mobile-user {
    display: flex;
  }
  .user-btn__name,
  .role-tag {
    display: inline;
  }
}
.appbar__mobile-user {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
  padding: var(--sp-3) var(--sp-3) 0;
  border-top: 1px solid var(--c-border);
}
.appbar__mobile-user .who {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 500;
}

.page {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-4) var(--sp-10);
  flex: 1;
}
.page--narrow {
  max-width: 880px;
}
/* 넓은 표 화면(행사 목록): PC 에서 좌우를 꽉 채운다 */
.page--fluid {
  max-width: none;
}
@media (min-width: 768px) {
  .page {
    padding: var(--sp-8) var(--sp-6) 64px;
  }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}
.page-head__title {
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.page-head__sub {
  margin-top: var(--sp-1);
  color: var(--c-text-3);
  font-size: var(--fs-md);
}
.page-head__actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.crumb {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  margin-bottom: var(--sp-2);
  color: var(--c-text-3);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.crumb:hover {
  color: var(--c-text);
  text-decoration: none;
}

/* ---------- 버튼 ---------- */
.btn {
  --btn-bg: var(--c-surface);
  --btn-fg: var(--c-text);
  --btn-bd: var(--c-border-strong);
  --btn-bg-h: var(--c-surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: var(--ctl-h);
  padding: 0 var(--sp-4);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease),
    box-shadow 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:hover {
  background: var(--btn-bg-h);
  text-decoration: none;
}
.btn:active {
  transform: translateY(0.5px);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}
.btn--primary {
  --btn-bg: var(--c-primary);
  --btn-fg: #fff;
  --btn-bd: var(--c-primary);
  --btn-bg-h: var(--c-primary-hover);
  box-shadow: var(--shadow-sm);
}
.btn--danger {
  --btn-bg: var(--c-danger);
  --btn-fg: #fff;
  --btn-bd: var(--c-danger);
  --btn-bg-h: var(--c-danger-hover);
}
.btn--danger-ghost {
  --btn-fg: var(--c-danger);
  --btn-bd: var(--c-danger-line);
  --btn-bg-h: var(--c-danger-soft);
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-bd: transparent;
  --btn-bg-h: var(--c-surface-3);
  --btn-fg: var(--c-text-2);
}
.btn--soft {
  --btn-bg: var(--c-primary-soft);
  --btn-bd: transparent;
  --btn-fg: var(--c-primary);
  --btn-bg-h: #dde7fc;
}
.btn--sm {
  height: var(--ctl-h-sm);
  padding: 0 var(--sp-3);
  font-size: var(--fs-sm);
}
.btn--block {
  width: 100%;
}
.btn--icon {
  width: var(--ctl-h);
  padding: 0;
}
.btn--icon.btn--sm {
  width: var(--ctl-h-sm);
}
.btn--dashed {
  --btn-bd: var(--c-border-strong);
  --btn-fg: var(--c-text-2);
  border-style: dashed;
  background: transparent;
}
.btn--dashed:hover {
  --btn-bd: var(--c-primary-line);
  color: var(--c-primary);
  background: var(--c-primary-soft);
}

/* ---------- 폼 ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text-2);
}
.field__label .req {
  color: var(--c-danger);
  margin-left: 2px;
}
.field__hint {
  font-size: var(--fs-xs);
  color: var(--c-text-3);
}
.field__error {
  font-size: var(--fs-xs);
  color: var(--c-danger);
  font-weight: 500;
}

.input,
.select,
.textarea {
  width: 100%;
  min-width: 0;
  height: var(--ctl-h);
  padding: 0 var(--sp-3);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: var(--fs-md);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.textarea {
  height: auto;
  min-height: 96px;
  padding: 10px var(--sp-3);
  line-height: 1.6;
  resize: vertical;
}
.textarea--code {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.5;
  tab-size: 2;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}
.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6b7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.input:hover,
.select:hover,
.textarea:hover {
  border-color: #b3bdca;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-focus);
}
.input[aria-invalid="true"],
.textarea[aria-invalid="true"],
.is-invalid {
  border-color: var(--c-danger) !important;
}
.input[aria-invalid="true"]:focus,
.textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.2);
}
.input--num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1023px) {
  /* iOS 확대 방지 */
  .input,
  .select,
  .textarea {
    font-size: var(--fs-lg);
  }
  .textarea--code {
    font-size: var(--fs-md);
  }
}

.input-icon {
  position: relative;
}
.input-icon > .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-4);
  pointer-events: none;
}
.input-icon > .input {
  padding-left: 36px;
}

.form-grid {
  display: grid;
  gap: var(--sp-5) var(--sp-4);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .form-grid--2 {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid .span-2 {
    grid-column: 1 / -1;
  }
}

.form-actions {
  display: flex;
  gap: var(--sp-2);
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* 토글 스위치 */
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: var(--touch);
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.switch:hover {
  border-color: var(--c-border-strong);
}
.switch__label {
  font-weight: 500;
}
.switch input[type="checkbox"] {
  appearance: none;
  flex: none;
  position: relative;
  width: 40px;
  height: 24px;
  margin: 0;
  border-radius: 12px;
  background: #c5cdd8;
  cursor: pointer;
  transition: background-color 0.18s var(--ease);
}
.switch input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s var(--ease);
}
.switch input[type="checkbox"]:checked {
  background: var(--c-primary);
}
.switch input[type="checkbox"]:checked::after {
  transform: translateX(16px);
}
.switch input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}
.switch:has(input[type="checkbox"]:checked) {
  border-color: var(--c-primary-line);
  background: var(--c-primary-soft);
}

/* 체크박스 */
.check {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--ctl-h);
  cursor: pointer;
  font-weight: 500;
}
.check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--c-primary);
}

/* ---------- 스테퍼 ---------- */
.stepper {
  --st-h: var(--ctl-h);
  display: inline-flex;
  align-items: stretch;
  height: var(--st-h);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
  overflow: hidden;
  flex: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.stepper:focus-within {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-focus);
}
.stepper__btn {
  display: grid;
  place-items: center;
  width: var(--st-h);
  border: 0;
  background: var(--c-surface-2);
  color: var(--c-text-2);
  transition: background-color 0.12s var(--ease), color 0.12s var(--ease);
  touch-action: manipulation;
}
.stepper__btn:hover {
  background: var(--c-surface-3);
  color: var(--c-text);
}
.stepper__btn:active {
  background: #dfe5ec;
}
.stepper__btn:disabled {
  color: var(--c-text-4);
  background: var(--c-surface-2);
  opacity: 0.55;
}
.stepper__btn:focus-visible {
  outline-offset: -2px;
}
.stepper__input {
  width: 48px;
  min-width: 0;
  border: 0;
  border-left: 1px solid var(--c-border);
  border-right: 1px solid var(--c-border);
  background: var(--c-surface);
  text-align: center;
  font-weight: 600;
  font-size: var(--fs-base);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  padding: 0;
  margin: 0;
  border-radius: 0;
  appearance: textfield;
  -moz-appearance: textfield;
}
.stepper__input::-webkit-inner-spin-button,
.stepper__input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stepper__input:focus {
  outline: none;
  background: var(--c-primary-soft);
}
.stepper-row {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
.stepper-unit {
  color: var(--c-text-3);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

/* ---------- 카드·패널 ---------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-border);
}
.card__title {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card__body {
  padding: var(--sp-5);
}
.card__foot {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.card + .card {
  margin-top: var(--sp-5);
}
@media (max-width: 767px) {
  .card__head,
  .card__body {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }
  .card__foot {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }
}

.section-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: var(--sp-3);
}

/* ---------- 배지 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  background: var(--c-surface-3);
  color: var(--c-text-2);
}
.badge--dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge--tentative {
  border: 1px dashed var(--st-tentative-line);
  background: var(--st-tentative-bg);
  color: var(--st-tentative-fg);
}
.badge--tentative::before {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
}
.badge--registered {
  background: #eef1f5;
  color: #4a5567;
}
.badge--settled {
  background: #e3ecfd;
  color: #1f48b0;
}
.badge--invoiced {
  background: var(--c-success-soft);
  color: var(--c-success);
}
.badge--warn {
  background: var(--c-warn-soft);
  color: var(--c-warn);
}
.badge--danger {
  background: var(--c-danger-soft);
  color: var(--c-danger);
}
.badge--info {
  background: var(--c-info-soft);
  color: var(--c-info);
}
.badge--muted {
  background: var(--c-surface-3);
  color: var(--c-text-3);
}
.badge--xs {
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  font-size: 11px;
}

/* ---------- 표 ---------- */
.table-card {
  overflow: hidden;
}
.table {
  font-size: var(--fs-md);
}
.table th {
  position: sticky;
  top: 0;
  padding: 10px var(--sp-4);
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.table td {
  padding: 12px var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table tbody tr {
  transition: background-color 0.12s var(--ease);
}
.table tbody tr:hover {
  background: #f8fafd;
}
.table .ta-r {
  text-align: right;
}
.table .ta-c {
  text-align: center;
}
.table .nowrap {
  white-space: nowrap;
}
.table .col-act {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}
.table .muted {
  color: var(--c-text-3);
}
.table .sub {
  display: block;
  color: var(--c-text-3);
  font-size: var(--fs-xs);
  margin-top: 2px;
}
.table tr.is-review {
  background: #fffaf0;
}
.table tr.is-review:hover {
  background: #fff4e0;
}
.table tr.is-inactive td {
  color: var(--c-text-4);
}
.table-group th {
  position: static;
  background: var(--c-surface-3);
  color: var(--c-text-2);
  font-size: var(--fs-sm);
  padding-top: 8px;
  padding-bottom: 8px;
}
.table-group .count {
  margin-left: var(--sp-2);
  color: var(--c-text-3);
  font-weight: 500;
}

/* 좁은 화면에서 행을 카드로 쌓기 */
@media (max-width: 767px) {
  .table--stack thead {
    display: none;
  }
  .table--stack,
  .table--stack tbody,
  .table--stack tr,
  .table--stack td {
    display: block;
    width: 100%;
  }
  .table--stack tr {
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--c-border);
  }
  .table--stack tbody tr:last-child {
    border-bottom: 0;
  }
  .table--stack td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-3);
    padding: 3px 0;
    border: 0;
    text-align: right;
  }
  .table--stack td.ta-r,
  .table--stack td.ta-c {
    text-align: right;
  }
  .table--stack td[data-label]::before {
    content: attr(data-label);
    color: var(--c-text-3);
    font-size: var(--fs-sm);
    font-weight: 500;
    text-align: left;
    flex: none;
  }
  .table--stack td.td-main {
    display: block;
    text-align: left;
    padding-bottom: var(--sp-2);
    font-weight: 600;
  }
  .table--stack td.col-act {
    justify-content: flex-end;
    padding-top: var(--sp-2);
    width: 100%;
  }
  .table--stack .table-group {
    display: block;
  }
  .table--stack .table-group th {
    display: block;
    padding: 8px var(--sp-4);
  }
  .table--stack td:empty {
    display: none;
  }
}

/* ---------- 빈 상태·로딩 ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-3);
  padding: 56px var(--sp-6);
  color: var(--c-text-3);
}
.empty__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c-surface-3);
  color: var(--c-text-3);
}
.empty__title {
  color: var(--c-text);
  font-size: var(--fs-lg);
  font-weight: 600;
}
.empty__actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--sp-1);
}

.spin {
  animation: px-spin 0.8s linear infinite;
}
@keyframes px-spin {
  to {
    transform: rotate(360deg);
  }
}
.skeleton {
  display: block;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, #edf0f4 25%, #f6f8fa 37%, #edf0f4 63%);
  background-size: 400% 100%;
  animation: px-shimmer 1.4s ease infinite;
}
@keyframes px-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .spin {
    animation: none;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 알림(flash·토스트) ---------- */
.toasts {
  position: fixed;
  top: calc(var(--appbar-h) + var(--sp-3));
  right: var(--sp-4);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-border);
  border-left-width: 3px;
  border-radius: var(--r-md);
  background: var(--c-surface);
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  pointer-events: auto;
  animation: px-toast-in 0.22s var(--ease);
}
.toast__icon {
  margin-top: 1px;
}
.toast__text {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}
.toast__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -3px -3px -3px 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--c-text-3);
}
.toast__close:hover {
  background: var(--c-surface-3);
}
.toast--success {
  border-left-color: var(--c-success);
}
.toast--success .toast__icon {
  color: var(--c-success);
}
.toast--error {
  border-left-color: var(--c-danger);
}
.toast--error .toast__icon {
  color: var(--c-danger);
}
.toast.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
@keyframes px-toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}
@media (max-width: 767px) {
  .toasts {
    top: var(--sp-2);
    left: var(--sp-2);
    right: var(--sp-2);
    width: auto;
  }
}

.alert {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--c-danger-line);
  background: var(--c-danger-soft);
  color: var(--c-danger);
  font-weight: 500;
}
.alert .icon {
  margin-top: 1px;
}
.alert--warn {
  border-color: var(--c-warn-line);
  background: var(--c-warn-soft);
  color: var(--c-warn);
}

/* ---------- 메뉴(팝오버) ---------- */
.menu {
  position: fixed;
  z-index: 80;
  min-width: 180px;
  max-width: calc(100vw - 16px);
  padding: var(--sp-1);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  box-shadow: var(--shadow-lg);
  animation: px-menu-in 0.14s var(--ease);
}
@keyframes px-menu-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
}
.menu form {
  margin: 0;
}
.menu__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: 36px;
  padding: 0 var(--sp-3);
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--c-text);
  font-size: var(--fs-md);
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  text-decoration: none;
}
.menu__item .icon {
  color: var(--c-text-3);
}
.menu__item:hover,
.menu__item:focus-visible {
  background: var(--c-surface-3);
  text-decoration: none;
  outline: none;
}
.menu__item:disabled {
  color: var(--c-text-4);
  background: transparent;
}
.menu__item--danger,
.menu__item--danger .icon {
  color: var(--c-danger);
}
.menu__item--danger:hover {
  background: var(--c-danger-soft);
}
.menu__item.is-current {
  color: var(--c-primary);
  font-weight: 600;
}
.menu__item.is-current .icon {
  color: var(--c-primary);
}
.menu__item .menu__check {
  margin-left: auto;
}
.menu__item.is-checked .menu__check {
  color: var(--c-primary);
}
.menu__sep {
  height: 1px;
  margin: var(--sp-1) 0;
  background: var(--c-border);
}
.menu__label {
  padding: 6px var(--sp-3) 4px;
  color: var(--c-text-3);
  font-size: var(--fs-xs);
  font-weight: 600;
}
@media (pointer: coarse), (max-width: 1023px) {
  .menu__item {
    min-height: var(--touch);
  }
}

/* ---------- 대화상자 ---------- */
.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.dialog[open] {
  display: flex;
  flex-direction: column;
  animation: px-dialog-in 0.2s var(--ease);
}
.dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
@keyframes px-dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
}
.dialog--sm {
  width: min(420px, calc(100vw - 32px));
}
.dialog--lg {
  width: min(720px, calc(100vw - 32px));
}
.dialog__form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  margin: 0;
}
.dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-border);
  flex: none;
}
.dialog__title {
  font-size: var(--fs-lg);
  font-weight: 700;
}
.dialog__body {
  padding: var(--sp-5);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.dialog__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-2);
  flex: none;
}
.dialog__foot .spacer {
  margin-right: auto;
}
.confirm__body {
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  display: flex;
  gap: var(--sp-4);
}
.confirm__icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--c-danger-soft);
  color: var(--c-danger);
}
.confirm__title {
  font-size: var(--fs-lg);
  font-weight: 700;
}
.confirm__detail {
  margin-top: var(--sp-1);
  color: var(--c-text-2);
}

@media (max-width: 767px) {
  /* 폰: 아래에서 올라오는 시트 */
  .dialog,
  .dialog--sm,
  .dialog--lg {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 24px);
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }
  .dialog[open] {
    animation: px-sheet-in 0.24s var(--ease);
  }
  .dialog__foot {
    padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
  }
  .dialog__foot .btn {
    flex: 1;
  }
  .dialog__foot .spacer {
    flex: 0 0 auto;
  }
}
@keyframes px-sheet-in {
  from {
    transform: translateY(40px);
    opacity: 0.6;
  }
}

/* ---------- 로그인 ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--sp-6) var(--sp-4);
  background:
    radial-gradient(1200px 600px at 50% -10%, #e4ebfb 0%, rgba(228, 235, 251, 0) 60%),
    var(--c-bg);
}
.login__card {
  width: min(400px, 100%);
  padding: var(--sp-8);
}
.login__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-8);
}
.login__brand .brand__mark {
  width: 44px;
  height: 44px;
}
.login__title {
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.login__form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.login__form .btn {
  height: 46px;
  margin-top: var(--sp-2);
  font-size: var(--fs-base);
}
.login__remember {
  align-self: flex-start;
  min-height: 0;
  color: var(--c-text-2);
}
.login__foot {
  margin-top: var(--sp-6);
  text-align: center;
  color: var(--c-text-4);
  font-size: var(--fs-xs);
}
@media (max-width: 480px) {
  .login__card {
    padding: var(--sp-6) var(--sp-5);
  }
}

/* ---------- 오프라인(서비스 워커가 연결 실패 때 보여 줌) ---------- */
.offline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-5);
  text-align: center;
}
.offline__mark {
  width: 48px;
  height: 48px;
}
.offline__title {
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.offline .btn {
  height: 46px;
  font-size: var(--fs-base);
}

/* ---------- 홈 화면 앱(standalone): 노치·상태 표시줄 안전 영역 ---------- */
@media (display-mode: standalone) {
  :root {
    --appbar-h: calc(56px + env(safe-area-inset-top));
  }
  .appbar {
    padding-top: env(safe-area-inset-top);
  }
  .appbar__inner {
    padding-left: max(var(--sp-4), env(safe-area-inset-left));
    padding-right: max(var(--sp-4), env(safe-area-inset-right));
  }
  .login {
    padding-top: max(var(--sp-6), env(safe-area-inset-top));
    padding-bottom: max(var(--sp-6), env(safe-area-inset-bottom));
  }
}
@media (display-mode: standalone) and (max-width: 767px) {
  .appbar__inner {
    padding-right: max(var(--sp-2), env(safe-area-inset-right));
  }
}

/* ---------- 행사 목록 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
@media (min-width: 768px) {
  .stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (max-width: 767px) {
  .stats > .stat:first-child {
    grid-column: 1 / -1;
  }
}
.stat {
  display: block;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  min-width: 0;
}
a.stat:hover {
  text-decoration: none;
  border-color: var(--c-primary-line);
  box-shadow: var(--shadow-md);
}
.stat.is-active {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 1px var(--c-primary) inset;
}
.stat__label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--c-text-3);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.stat__value {
  margin-top: 6px;
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat__unit {
  margin-left: 2px;
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--c-text-3);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.dot--tentative {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--st-tentative-fg);
}
.dot--registered {
  background: #8a94a3;
}
.dot--settled {
  background: #2457d6;
}
.dot--invoiced {
  background: #1f9d5c;
}

.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.filters .filters__q {
  grid-column: 1 / -1;
}
.filters .filters__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: var(--sp-2);
}
.filters .filters__actions .btn {
  flex: 1;
}
@media (min-width: 900px) {
  .filters {
    grid-template-columns: 150px 140px 160px minmax(0, 1fr) auto;
  }
  .filters .filters__q,
  .filters .filters__actions {
    grid-column: auto;
  }
  .filters .filters__actions .btn {
    flex: none;
  }
}

.event-name {
  font-weight: 600;
  color: var(--c-text);
}
.event-name:hover {
  color: var(--c-primary);
}
.table tr[data-href] {
  cursor: pointer;
}

.event-cards {
  display: none;
}
@media (max-width: 767px) {
  .event-table {
    display: none;
  }
  .event-cards {
    display: block;
  }
}
.event-card {
  display: block;
  padding: var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
}
.event-card:last-child {
  border-bottom: 0;
}
.event-card:hover,
.event-card:active {
  background: var(--c-surface-2);
  text-decoration: none;
}
.event-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}
.event-card__name {
  font-weight: 600;
  font-size: var(--fs-base);
  line-height: 1.4;
}
.event-card__meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px var(--sp-3);
  color: var(--c-text-3);
  font-size: var(--fs-sm);
}
.event-card__amount {
  margin-top: 4px;
  color: var(--c-text);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
}
.event-table .event-amount {
  font-weight: 500;
}
.event-table .col-act .btn ~ .btn {
  margin-left: 2px;
}

/* ---------- 행사 등록 폼 ---------- */
.days-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--ctl-h);
  padding: 0 var(--sp-3);
  border-radius: var(--r-md);
  background: var(--c-surface-3);
  color: var(--c-text-2);
  font-weight: 600;
  white-space: nowrap;
}
.days-pill.is-error {
  background: var(--c-danger-soft);
  color: var(--c-danger);
}
.date-range {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.date-range .dp {
  flex: 1 1 auto;
  min-width: 0;
}
.date-range .days-pill {
  flex: none;
}

/* 행사 인원: 고른 이름 칩 + 이름 버튼 */
.member-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: var(--ctl-h);
  padding: 4px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
}
.member-input[aria-invalid="true"] {
  border-color: var(--c-danger);
}
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: calc(var(--ctl-h) - 10px);
  padding: 0 2px 0 10px;
  border-radius: var(--r-sm);
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-size: var(--fs-md);
  font-weight: 600;
  white-space: nowrap;
}
.member-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.15s var(--ease);
}
.member-chip__remove:hover {
  background: rgba(36, 87, 214, 0.12);
}
.member-picks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.member-pick {
  min-width: 72px;
  height: var(--ctl-h);
  padding: 0 var(--sp-3);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.member-pick:hover {
  background: var(--c-surface-2);
}
.member-pick[aria-pressed="true"] {
  border-color: var(--c-primary);
  background: var(--c-primary);
  color: #fff;
}
.member-pick[aria-pressed="true"]:hover {
  background: var(--c-primary-hover);
}
@media (pointer: coarse), (max-width: 1023px) {
  .member-chip__remove {
    width: 32px;
    height: 32px;
  }
  .member-pick {
    min-width: 80px;
  }
}
.select:disabled {
  background-color: var(--c-surface-2);
  color: var(--c-text-2);
  cursor: default;
}

/* ---------- 기간 달력 ---------- */
.dp {
  position: relative;
}
.dp-trigger {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-align: left;
  cursor: pointer;
}
.dp-trigger .icon {
  flex: none;
  color: var(--c-text-3);
}
.dp-trigger:disabled {
  background-color: var(--c-surface-2);
  color: var(--c-text-2);
  cursor: default;
}
.dp-trigger[aria-expanded="true"] {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-focus);
}
.dp-trigger[aria-invalid="true"]:focus,
.dp-trigger[aria-invalid="true"][aria-expanded="true"] {
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.2);
}
.dp-value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dp-value.is-empty {
  color: var(--c-text-4);
}
.dp-pop {
  --dp-accent: var(--c-primary);
  --dp-band: var(--c-primary-soft);
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  padding: var(--sp-5);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: var(--shadow-lg);
}
.dp-nav {
  position: absolute;
  top: var(--sp-5);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--c-text);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s var(--ease);
}
.dp-nav:hover {
  background: var(--c-surface-3);
}
.dp-nav:focus-visible {
  outline: 2px solid var(--dp-accent);
  outline-offset: 1px;
}
.dp-prev {
  left: var(--sp-5);
}
.dp-next {
  right: var(--sp-5);
}
.dp-months {
  display: grid;
  grid-template-columns: repeat(var(--dp-n, 2), 280px);
  gap: var(--sp-10);
}
.dp-title {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.dp-week,
.dp-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.dp-days {
  row-gap: 2px;
}
.dp-week span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-text-3);
}
.dp-cell {
  --band: var(--dp-band);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
}
.dp-cell.pv {
  --band: var(--c-surface-3);
}
.dp-cell.in {
  background: var(--band);
}
.dp-cell.in:nth-child(7n + 1) {
  border-radius: 20px 0 0 20px;
}
.dp-cell.in:nth-child(7n) {
  border-radius: 0 20px 20px 0;
}
.dp-cell.from {
  background: linear-gradient(90deg, transparent 50%, var(--band) 50%);
}
.dp-cell.to {
  background: linear-gradient(90deg, var(--band) 50%, transparent 50%);
}
.dp-cell.from:nth-child(7n),
.dp-cell.to:nth-child(7n + 1) {
  background: none;
}
.dp-day {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--c-text);
  font-size: var(--fs-md);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s var(--ease), box-shadow 0.15s var(--ease), color 0.15s var(--ease);
}
.dp-day:hover,
.dp-day.hov {
  box-shadow: inset 0 0 0 1.5px var(--dp-accent);
}
.dp-day:focus-visible {
  outline: 2px solid var(--dp-accent);
  outline-offset: 1px;
}
.dp-week .sun,
.dp-day.sun {
  color: var(--c-danger);
}
.dp-week .sat,
.dp-day.sat {
  color: var(--c-primary);
}
.dp-day.today {
  font-weight: 700;
}
.dp-day.today::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--dp-accent);
}
.dp-day.edge {
  background: var(--dp-accent);
  color: #fff;
  font-weight: 700;
  box-shadow: none;
}
.dp-day.edge.today::after {
  background: #fff;
}
.dp-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-border);
}
.dp-foot .btn {
  min-width: 72px;
}
@media (max-width: 719px) {
  .dp-pop {
    width: calc(100vw - 32px);
    padding: var(--sp-4) var(--sp-3);
  }
  .dp-nav {
    top: var(--sp-4);
    width: 40px;
    height: 40px;
  }
  .dp-prev {
    left: var(--sp-2);
  }
  .dp-next {
    right: var(--sp-2);
  }
  .dp-months {
    grid-template-columns: minmax(0, 1fr);
  }
  .dp-title {
    height: 40px;
  }
  .dp-cell {
    height: 44px;
  }
  .dp-cell.in:nth-child(7n + 1) {
    border-radius: 22px 0 0 22px;
  }
  .dp-cell.in:nth-child(7n) {
    border-radius: 0 22px 22px 0;
  }
  .dp-day {
    width: 100%;
    max-width: 44px;
    height: 44px;
    border-radius: 22px;
    font-size: var(--fs-base);
  }
  .dp-foot .btn {
    flex: 1;
  }
}
.space-setup {
  display: grid;
  gap: var(--sp-2);
  align-items: start;
}
@media (min-width: 640px) {
  .space-setup {
    grid-template-columns: 1fr 1fr;
  }
}
.space-setup .switch {
  min-height: calc(var(--ctl-h) + var(--sp-2) * 2 + 2px);
}
.space-setup .switch--stepper {
  cursor: default;
}
.space-etc {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.space-etc:hover {
  border-color: var(--c-border-strong);
}
.space-etc:has(input[type="checkbox"]:checked) {
  border-color: var(--c-primary-line);
  background: var(--c-primary-soft);
}
.space-setup .space-etc > .switch {
  min-height: calc(var(--ctl-h) + var(--sp-2) * 2);
  border: 0;
  border-radius: inherit;
  background: transparent;
}
.space-etc__name {
  display: none;
  padding: 0 var(--sp-4) var(--sp-3);
}
.space-etc:has(input[type="checkbox"]:checked) .space-etc__name {
  display: block;
}

.layout-side {
  display: grid;
  gap: var(--sp-5);
  align-items: start;
}
@media (min-width: 1024px) {
  .layout-side {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}
.action-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.action-list form {
  margin: 0;
}
.action-list .btn {
  width: 100%;
  justify-content: flex-start;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin-top: var(--sp-5);
  padding: var(--sp-3) 0 calc(var(--sp-3) + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--c-bg) 70%, rgba(244, 246, 249, 0));
}
@media (max-width: 767px) {
  .sticky-actions .btn {
    flex: 1;
  }
}

/* ---------- 관리 화면 ---------- */
.admin {
  display: grid;
  gap: var(--sp-5);
  align-items: start;
}
@media (min-width: 1024px) {
  .admin {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: var(--sp-8);
  }
}
.admin-nav {
  display: flex;
  gap: var(--sp-1);
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(var(--sp-4) * -1);
  padding: 0 var(--sp-4) 2px;
}
.admin-nav::-webkit-scrollbar {
  display: none;
}
.admin-nav__title {
  display: none;
}
.admin-nav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 40px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-md);
  color: var(--c-text-2);
  font-weight: 500;
  white-space: nowrap;
  flex: none;
}
.admin-nav__link:hover {
  background: var(--c-surface-3);
  color: var(--c-text);
  text-decoration: none;
}
.admin-nav__link.is-active {
  background: var(--c-surface);
  color: var(--c-primary);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--c-border);
}
.admin-nav__link .icon {
  color: inherit;
  opacity: 0.85;
}
@media (min-width: 1024px) {
  .admin-nav {
    position: sticky;
    top: calc(var(--appbar-h) + var(--sp-8));
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
  .admin-nav__title {
    display: block;
    padding: 0 var(--sp-3) var(--sp-2);
    color: var(--c-text-3);
    font-size: var(--fs-xs);
    font-weight: 600;
  }
  .admin-nav__link {
    height: 38px;
  }
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  margin-bottom: var(--sp-4);
}
.toolbar__grow {
  flex: 1 1 220px;
  min-width: 0;
}
.toolbar .select {
  width: auto;
  min-width: 140px;
}
@media (max-width: 767px) {
  .toolbar .select {
    flex: 1 1 140px;
  }
}
.result-count {
  color: var(--c-text-3);
  font-size: var(--fs-sm);
  margin-left: auto;
}

.price-cell {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.code {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--c-text-3);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  background: var(--c-surface-3);
  color: var(--c-text-2);
  font-size: var(--fs-xs);
  font-weight: 500;
}

/* 공간 구성 편집 */
.type-tabs {
  display: flex;
  gap: var(--sp-1);
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  margin-bottom: var(--sp-4);
}
.type-tabs::-webkit-scrollbar {
  display: none;
}
.type-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: 19px;
  background: var(--c-surface);
  color: var(--c-text-2);
  font-weight: 600;
}
.type-tab:hover {
  border-color: var(--c-border-strong);
}
.type-tab[aria-selected="true"] {
  border-color: var(--c-primary);
  background: var(--c-primary);
  color: #fff;
}
.type-tab .count {
  font-size: var(--fs-xs);
  font-weight: 500;
  opacity: 0.75;
}

.edit-rows {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.edit-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  transition: box-shadow 0.15s var(--ease), border-color 0.15s var(--ease);
}
.edit-row:focus-within {
  border-color: var(--c-primary-line);
}
.edit-row.is-flash {
  box-shadow: 0 0 0 3px var(--c-focus);
}
.edit-row__no {
  text-align: center;
  color: var(--c-text-4);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.edit-row__tools {
  display: flex;
  gap: 2px;
}
@media (max-width: 639px) {
  .edit-row {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    grid-template-areas:
      "no main main"
      ". qty tools";
  }
  .edit-row__no {
    grid-area: no;
  }
  .edit-row__main {
    grid-area: main;
  }
  .edit-row__qty {
    grid-area: qty;
  }
  .edit-row__tools {
    grid-area: tools;
  }
}

.q-card {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
}
.q-card + .q-card {
  margin-top: var(--sp-3);
}
.q-card__head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface-2);
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.q-card__title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.q-card__body {
  padding: var(--sp-4);
  display: grid;
  gap: var(--sp-3);
}
.q-card__grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .q-card__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 140px;
  }
}
.q-card.is-error {
  border-color: var(--c-danger-line);
}
.json-status {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 500;
}
.json-status.is-ok {
  color: var(--c-success);
}
.json-status.is-error {
  color: var(--c-danger);
}
.json-status.is-warn {
  color: var(--c-warn);
}
.json-status .icon {
  margin-top: 1px;
}
.json-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.subsection {
  margin-top: var(--sp-6);
}
.subsection__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.subsection__title {
  font-size: var(--fs-base);
  font-weight: 700;
}
.subsection__title .count {
  margin-left: 6px;
  color: var(--c-text-3);
  font-weight: 500;
}

.account-grid {
  display: grid;
  gap: var(--sp-4);
}
@media (min-width: 900px) {
  .account-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.ban-section {
  margin-top: var(--sp-6);
}
.ban-section__title {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-md);
  font-weight: 700;
}
.ban-section__title .count {
  margin-left: 6px;
  color: var(--c-text-3);
  font-weight: 500;
}
.account-grid .card + .card {
  margin-top: 0;
}
.account-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.account-head .avatar {
  width: 40px;
  height: 40px;
  font-size: var(--fs-base);
}
.account-head__name {
  font-weight: 700;
}
.account-head__id {
  color: var(--c-text-3);
  font-size: var(--fs-sm);
}
.account-card {
  display: flex;
  flex-direction: column;
}
.account-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.account-sec {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.account-sec + .account-sec {
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--c-border);
  flex: 1;
}
.account-sec .field__label {
  margin-bottom: -6px;
}
.account-sec .field .field__label {
  margin-bottom: 0;
}
.account-row {
  display: flex;
  gap: var(--sp-2);
  align-items: stretch;
}
.account-row .input {
  flex: 1 1 0;
  min-width: 0;
}
.account-row .btn {
  flex: none;
}
.account-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: var(--sp-1);
}

.inline-form {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.inline-form .input {
  flex: 1 1 220px;
}

.text-muted {
  color: var(--c-text-3);
}
.text-danger {
  color: var(--c-danger);
}
.mt-4 {
  margin-top: var(--sp-4);
}
.mt-6 {
  margin-top: var(--sp-6);
}
/* 원래 display(.btn 의 inline-flex 등)를 덮어쓰지 않도록 숨기는 쪽만 지정한다 */
@media (min-width: 768px) {
  .only-mobile {
    display: none !important;
  }
}
@media (max-width: 767px) {
  .hide-mobile {
    display: none !important;
  }
}

/* ---------- 자동완성(콤보박스) ---------- */
.combo {
  position: relative;
}
.combo__list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  padding: var(--sp-1);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  box-shadow: var(--shadow-lg);
}
.combo__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 38px;
  padding: 6px var(--sp-3);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.combo__opt:hover,
.combo__opt[aria-selected="true"] {
  background: var(--c-primary-soft);
}
.combo__main {
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.combo__hit {
  font-weight: 700;
}
.combo__sub {
  flex: none;
  color: var(--c-text-3);
  font-size: var(--fs-sm);
}
.combo__head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}
.combo__tag {
  flex: none;
}
.venue-cal {
  min-width: 0;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--c-text-3);
  font-size: var(--fs-sm);
}
.field__hint--clip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 메모 보기(요약·장비 내역, memo-dialog.js) ---------- */
.memo-dialog__titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.memo-dialog__event {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memo-dialog__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.memo-dialog__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-text-3);
  margin-bottom: var(--sp-1);
}
.memo-dialog__text {
  font-size: var(--fs-md);
  color: var(--c-text);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.memo-dialog__section + .memo-dialog__section {
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-border);
}
@media (pointer: coarse), (max-width: 1023px) {
  .combo__opt {
    min-height: var(--touch);
  }
}

/* ---------- 행사명 추천(레이블 오른쪽) ---------- */
.field__label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1) var(--sp-2);
  min-width: 0;
}
.name-suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-1) 6px;
  min-width: 0;
  max-width: 100%;
  margin: -2px 0;
}
.name-suggest:empty {
  display: none;
}
.name-suggest__src {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--c-text-4);
}
.name-suggest__chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: min(16rem, 100%);
  height: 20px;
  padding: 0 8px;
  border: 1px solid var(--c-primary-line);
  border-radius: 10px;
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.name-suggest__chip:hover {
  border-color: var(--c-primary);
  background: var(--c-surface);
}
.name-suggest__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (pointer: coarse) {
  .name-suggest__chip {
    height: 28px;
    border-radius: 14px;
    padding: 0 10px;
  }
}

.contact-group {
  margin: 0;
  padding: var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface-2);
  min-width: 0;
}
.contact-group > legend {
  padding: 0 var(--sp-1);
}
.field__label--sub {
  font-weight: 500;
  color: var(--c-text-3);
}
.contact-group .switch {
  align-self: end;
  min-height: var(--ctl-h);
  padding-block: 0;
}
.dialog__titles {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}
.contact-chips {
  justify-content: flex-start;
}
.chip--btn,
.chip--add {
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  background: var(--c-surface);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.chip--btn:hover {
  border-color: var(--c-primary-line);
  background: var(--c-primary-soft);
}
.chip__sub {
  color: var(--c-text-3);
  font-size: var(--fs-xs);
}
.chip--add {
  border-style: dashed;
  color: var(--c-text-3);
}
.chip--add:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}
@media (pointer: coarse), (max-width: 1023px) {
  .chip--btn,
  .chip--add {
    height: 36px;
    border-radius: 18px;
  }
}
@media (max-width: 767px) {
  .table--stack td .contact-chips {
    justify-content: flex-end;
  }
}
.type-tab.is-dirty::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d97706;
}
.type-tab[aria-selected="true"].is-dirty::after {
  background: #fcd34d;
}
