/* OFFSPACE 관리 앱 공통 스타일. 흰색 바탕에 검정 글자, 색은 예약 채널과 상태에만 쓴다. 밝은 화면 하나만 만든다. */
:root {
  --bg: #fafafa;        /* 화면 바탕 */
  --card: #ffffff;      /* 카드, 표, 입력 칸 */
  --line: #e4e4e7;      /* 선, 테두리 */
  --text: #18181b;      /* 글자 */
  --muted: #6b6b76;     /* 보조 글자 */
  --accent: #2f5fd0;    /* 기본 버튼, 선택된 메뉴 */
  --mark: #2f5fd0;      /* 링크, 오늘 날짜, 선택 표시 */
  --soft: #eef2fd;      /* 옅은 면 */
  --fill: #eeeef0;      /* 사진 자리, 꺼진 버튼 */
  --naver: #d9f2e1;     /* 네이버 예약 */
  --space: #e3e0fa;     /* 스페이스클라우드 예약 */
  --direct: #fdebc8;    /* 직접 예약 */
  --warn: #fff4d6;      /* 경고 */
  --neg: #b3261e;       /* 위험 */
  --neg-soft: #fde7e5;
  --ok: #1f7a45;        /* 완료 */
  --ok-soft: #dff3e6;
  --kakao: #fee500;
  --kakao-ink: #191919;
  --font: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --r: 8px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--font); }
a { color: var(--mark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 700; margin: 0; }
h2 { font-size: 17px; font-weight: 700; margin: 24px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.neg { color: var(--neg); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; }

/* 관리 화면 위 메뉴 줄 */
.top { display: flex; align-items: center; gap: 20px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.top .brand { font: 700 17px/1 var(--font); color: var(--text); letter-spacing: .06em; }
.top nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.top nav a { padding: 6px 10px; border-radius: 6px; color: var(--text); }
.top nav a.on { background: var(--accent); color: #fff; }
.count { background: var(--neg); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
.bar { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.bar h1, .bar h2 { margin: 0 12px 0 0; }
.bar .right { margin-left: auto; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: 500 15px/1.2 var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; opacity: .88; }
.btn.ghost { background: var(--card); color: var(--text); border-color: var(--line); }
.btn.ghost.on { background: var(--soft); color: var(--accent); border-color: var(--accent); }
.btn.danger { background: var(--neg); color: #fff; border-color: var(--neg); }
.btn.kakao { background: var(--kakao); color: var(--kakao-ink); border-color: var(--kakao); }
.btn.block { display: flex; width: 100%; min-height: 48px; font-size: 16px; }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn:disabled, .btn.off { background: var(--fill); border-color: var(--fill); color: var(--muted); cursor: not-allowed; opacity: 1; }
button.link { background: none; border: 0; color: var(--mark); font: inherit; cursor: pointer; padding: 0; }
.hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

/* 카드, 알림 띠 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 0 0 14px; }
.card.warn { background: var(--warn); }
.card.login { max-width: 360px; margin: 80px auto; display: flex; flex-direction: column; gap: 10px; }
.card ul { margin: 6px 0 0; padding-left: 20px; }
.banner { padding: 10px 14px; border-radius: 6px; background: var(--warn); margin: 0 0 14px; }
.banner.neg, .alert { padding: 10px 14px; border-radius: 6px; background: var(--neg-soft); color: var(--neg); }

/* 상태 배지: 청소 건 상태 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; line-height: 1.5; white-space: nowrap; border: 1px solid transparent; }
.badge.unassigned { background: var(--warn); }
.badge.requested { background: var(--soft); color: var(--mark); }
.badge.assigned { background: var(--card); color: var(--accent); border-color: var(--accent); }
.badge.cleaning { background: var(--accent); color: #fff; }
.badge.done { background: var(--ok-soft); color: var(--ok); }
.badge.paid { background: var(--fill); color: var(--muted); }
.badge.cancelled { background: var(--neg-soft); color: var(--neg); }

/* 채널 딱지: 달력과 목록의 예약 */
.res { display: block; padding: 2px 6px; margin-bottom: 3px; border-radius: 4px; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res.naver { background: var(--naver); }
.res.spacecloud { background: var(--space); }
.res.direct { background: var(--direct); }
.res.pending { border: 1px dashed var(--neg); }
.res.cancelled { background: var(--fill); color: var(--muted); text-decoration: line-through; }
.legend .res { display: inline-block; margin-right: 6px; }

/* 달력 */
table { border-collapse: collapse; width: 100%; background: var(--card); }
table.cal { table-layout: fixed; border: 1px solid var(--line); }
table.cal th { padding: 6px; font-size: 13px; font-weight: 400; color: var(--muted); border-bottom: 1px solid var(--line); }
table.cal td { height: 150px; vertical-align: top; border: 1px solid var(--line); padding: 4px; }
table.cal .res { white-space: normal; overflow: visible; word-break: keep-all; line-height: 1.35; }  /* 이름·인원·bbq 가 잘리지 않게 줄을 바꾼다 */
table.cal td.out { background: var(--bg); }
table.cal td.out .day { color: #b9b9c0; }
table.cal td.today { outline: 2px solid var(--mark); outline-offset: -2px; }
table.cal td.has { background: var(--soft); }
.day { display: block; font-size: 13px; color: var(--muted); margin-bottom: 2px; }

/* 목록 표 */
table.list th, table.list td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
table.list th { font-size: 13px; color: var(--muted); font-weight: 400; }
table.list td.num, table.list th.num { text-align: right; }
tr.cancelled td, tr.done td { color: var(--muted); }
tr.cancelled td a { text-decoration: line-through; }
tr.total td { font-weight: 700; }

/* 이름표와 값이 나란히 놓이는 줄 */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* 입력 칸 */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form label, .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form .wide { grid-column: 1 / -1; }
input, select, textarea { font: 400 15px/1.4 var(--font); min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
.field.error input { border-color: var(--neg); }
.field .why { color: var(--neg); }
.money { display: flex; align-items: center; gap: 6px; }
.money input { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
pre { white-space: pre-wrap; word-break: break-all; font-size: 13px; background: var(--bg); padding: 10px; border-radius: 6px; max-height: 400px; overflow: auto; }
details summary { cursor: pointer; }

/* 사진 올리기 칸 */
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photo { width: 72px; height: 72px; border-radius: 6px; background: var(--fill); border: 1px solid var(--line); }
.photo.add { display: flex; align-items: center; justify-content: center; background: var(--card); border-style: dashed; color: var(--muted); font-size: 13px; cursor: pointer; }

/* 체크리스트 줄 */
.check-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-row input { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); flex: none; }

/* 확인 창 */
.dialog { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; max-width: 360px; box-shadow: 0 12px 32px rgb(24 24 27 / .16); }
.dialog h3 { margin: 0 0 4px; font-size: 17px; }
.dialog .actions { display: flex; gap: 8px; margin-top: 16px; }
.dialog .actions .btn { flex: 1; }

/* 알바생 화면 아래 탭 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar a { flex: 1; min-height: 52px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.tabbar a.on { color: var(--accent); font-weight: 700; box-shadow: inset 0 2px 0 var(--accent); }

@media (max-width: 700px) {
  body { font-size: 16px; }
  h1 { font-size: 20px; }
  .btn, input, select, textarea { min-height: 44px; }
  .btn.small { min-height: 36px; }
  .form { grid-template-columns: 1fr; }
  table.cal td { height: 110px; }
  .res { font-size: 11px; padding: 1px 3px; }
  table.list { display: block; overflow-x: auto; }
}

.scroll { overflow-x: auto; }  /* 칸이 많은 표는 표 안에서만 옆으로 넘긴다 */
.scroll table.list td, .scroll table.list th { white-space: nowrap; }
