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

:root {
  --brand: #6c60f4;
  --brand-dark: #5546e0;
  --brand-soft: #ece9ff;
  --ink: #1c1c28;
  --muted: #6b6b7b;
  --line: #e7e7ef;
  --bg: #f6f6fb;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(28, 28, 40, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; line-height: 1.55;
}
a { color: var(--brand); text-decoration: none; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 96px; }

/* 헤더 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 720px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.brand .dot { width: 22px; height: 22px; border-radius: 8px; background: var(--brand); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; }
.topbar .who { font-size: 13px; color: var(--muted); }
.topbar .who b { color: var(--ink); }

/* 카드 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-top: 14px; }
.card h2 { margin: 0 0 12px; font-size: 17px; letter-spacing: -0.02em; }
.notice { background: var(--brand-soft); border: 1px solid #ddd7ff; color: #40348f; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-top: 14px; white-space: pre-wrap; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 15px; padding: 11px 16px; border-radius: 12px; background: var(--brand); color: #fff; transition: filter .12s, transform .04s; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.gray { background: #eef0f5; color: #444; }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid #f2c4c4; }
.btn.full { width: 100%; }
.btn.block { display: flex; width: 100%; }

/* 폼 */
label.fld { display: block; margin-top: 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
input[type=text], input[type=tel], input[type=password], input[type=number], input[type=date], textarea, select {
  width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; font-family: inherit; font-size: 15px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(108, 96, 244, .12); }
textarea { resize: vertical; min-height: 64px; }

/* 식단 카드 */
.menu-list { display: grid; gap: 14px; }
.menu { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.menu .photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #f0f0f6; display: block; cursor: zoom-in; }
.menu .photo.empty { display: flex; align-items: center; justify-content: center; color: #b9b9c8; font-size: 14px; aspect-ratio: 16/6; cursor: default; }
.menu .body { padding: 14px 16px 16px; }
.menu .dline { display: flex; align-items: baseline; gap: 8px; }
.menu .date { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.menu .wd { font-size: 13px; color: var(--muted); }
.menu .note { margin: 8px 0 10px; font-size: 14px; color: #45454f; white-space: pre-wrap; }
.menu .meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; color: var(--muted); align-items: center; margin-bottom: 12px; }
.menu .meta b { color: var(--ink); }
.row-actions { display: flex; gap: 8px; align-items: center; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.pill.applied { background: #e7f6ee; color: var(--ok); }
.pill.closed { background: #f3f3f6; color: #8a8a97; }
.pill.paid { background: var(--brand-soft); color: var(--brand-dark); }
.pill.warn { background: #fef3e2; color: var(--warn); }

/* 탭 */
.tabs { display: flex; gap: 6px; background: #eeeef4; padding: 4px; border-radius: 12px; margin-top: 14px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px; font-family: inherit; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.tabs button.on { background: #fff; color: var(--brand); box-shadow: var(--shadow); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty-note { text-align: center; color: var(--muted); padding: 36px 12px; font-size: 14px; }
.total-line { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px dashed var(--line); font-size: 15px; }
.total-line b { font-size: 18px; color: var(--brand-dark); }
.bank { background: #fbfaff; border: 1px dashed #d9d3ff; border-radius: 12px; padding: 12px 14px; font-size: 14px; white-space: pre-wrap; margin-top: 10px; }

/* 테이블(관리자) */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; font-weight: 700; }
td.center, th.center { text-align: center; }
td.right, th.right { text-align: right; }

/* 토스트 */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: #1c1c28; color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* 라이트박스 */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* 하단 고정 액션 */
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 12px 16px; z-index: 30; }
.sticky-cta-in { max-width: 720px; margin: 0 auto; }

.link-btn { background: none; border: 0; color: var(--brand); font-family: inherit; font-size: 14px; cursor: pointer; padding: 0; font-weight: 600; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
