/* CongKong 사내 도구 디자인(Project List · Estimate Pro)에 맞춘 스타일: 크림 배경, 코랄 포인트, Pretendard, 검정 기본 버튼 */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css");
:root {
  --bg: #f7f4ed;            /* cream */
  --surface: #faf8f3;       /* cream-light: 카드 */
  --raised: #ffffff;        /* 입력칸·로그인 카드 */
  --sunken: #f1eee6;        /* 카드 안의 안내 상자 */
  --ink: #1c1c1c;
  --muted: rgba(28, 28, 28, 0.6);
  --faint: rgba(28, 28, 28, 0.4);
  --line: #eceae4;
  --line-strong: rgba(28, 28, 28, 0.4);
  --coral: #ff5c35;
  --coral-deeper: #cc3d1a;
  --coral-soft: rgba(255, 92, 53, 0.08);
  --accent: #1c1c1c;        /* 기본 버튼은 검정 */
  --accent-ink: #fcfbf8;
  --accent-soft: rgba(28, 28, 28, 0.06);
  --warn: #c25e00; --warn-soft: rgba(255, 122, 0, 0.1);
  --bad: #d92c2c; --bad-soft: rgba(255, 59, 59, 0.1);
  --good: #008a52; --good-soft: rgba(0, 196, 115, 0.12);
  --blue: #0057d9; --blue-soft: rgba(0, 102, 255, 0.1);
  --font-body: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --font-num: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-sm: 6px;
  --r: 12px;
  --shadow-inset: rgba(255,255,255,0.2) 0 0.5px 0 0 inset, rgba(0,0,0,0.2) 0 0 0 0.5px inset, rgba(0,0,0,0.05) 0 1px 2px 0;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; font-feature-settings: "ss06"; }
.wrap { max-width: 1180px; margin: 0 auto; padding-block: 40px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 24px; }
.wrap > *, .tab-body > *, .admin-grid > *, .brand > * { min-width: 0; }
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.25; letter-spacing: -0.02em; }
p { margin: 0; }
.mono { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.label { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* 머리말: 코랄 알약 + 큰 제목 (Project List와 같은 구성) */
.topbar { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.brand { display: grid; gap: 10px; }
.brand .eyebrow { display: flex; gap: 8px; align-items: center; }
.brand h1 { font-size: clamp(32px, 6vw, 48px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.brand h1 em { font-style: normal; color: var(--coral); }
.brand p { font-size: 16px; color: var(--muted); max-width: 40em; }
/* 로그인 뒤에는 머리말을 한 줄로 줄여 작업 화면을 넓게 씀 */
body.signed-in .wrap { padding-block: 20px 40px; gap: 16px; }
body.signed-in .topbar { align-items: center; }
body.signed-in .brand { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
body.signed-in .brand h1 { font-size: 22px; letter-spacing: -0.02em; }
body.signed-in .brand .eyebrow .label, body.signed-in .brand p { display: none; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 20px; font-size: 12px; color: var(--faint); }

button, .btn { font: inherit; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); border-radius: var(--r-sm); padding: 10px 16px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; text-decoration: none; transition: background-color .15s ease-out, border-color .15s ease-out, opacity .15s ease-out; }
.btn:hover { border-color: var(--line-strong); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: var(--shadow-inset); }
.btn.primary:hover { opacity: .88; }
.btn.danger { background: var(--bad); border-color: transparent; color: #fff; box-shadow: var(--shadow-inset); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--coral-deeper); padding-inline: 6px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.big { width: 100%; padding: 15px 16px; font-size: 16px; }
.btn.google { width: 100%; padding: 13px 16px; font-size: 15px; }
.btn.google svg { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 9999px; white-space: nowrap; background: var(--sunken); color: var(--muted); border: 1px solid transparent; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--blue-soft); color: var(--blue); }
.pill.coral { background: var(--coral); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 12px; }
.pill.outline { background: transparent; border-color: var(--line-strong); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 12px; }

/* ---------- 스태프 (휴대폰) ---------- */
.phone { width: 100%; max-width: 430px; margin: 0 auto; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-height: 680px; overflow: clip; }
.ph-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px 12px; border-bottom: 1px solid var(--line); min-height: 56px; }
.ph-head .back { border: 0; background: transparent; color: var(--ink); font-size: 22px; line-height: 1; padding: 4px 8px 4px 0; }
.ph-head .ttl { font-weight: 700; font-size: 16px; flex: 1; letter-spacing: -0.01em; }
.ph-head .stepn { font-size: 12px; color: var(--faint); }
.progress { height: 3px; background: var(--line); }
.progress i { display: block; height: 100%; background: var(--coral); transition: width .25s; }
.ph-body { flex: 1; padding: 24px 18px 8px; display: grid; gap: 18px; align-content: start; }
.ph-foot { padding: 12px 18px calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: grid; gap: 8px; background: var(--raised); position: sticky; bottom: 0; z-index: 2; }
.lead { font-size: 24px; font-weight: 800; line-height: 1.3; letter-spacing: -0.03em; }
.box { background: var(--sunken); border-radius: var(--r-sm); padding: 14px 16px; display: grid; gap: 8px; }
.box h3 { font-size: 14px; }
.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; counter-increment: s; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--coral-soft); color: var(--coral-deeper); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.ticks { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

.slot { border: 1.5px dashed var(--line-strong); border-radius: var(--r); padding: 14px; display: grid; gap: 10px; }
.slot.filled { border-style: solid; border-color: var(--line); background: var(--surface); }
.slot-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.slot-h b { font-size: 15.5px; }
.slot .prev { width: 100%; aspect-ratio: 1.6; border-radius: var(--r-sm); background: var(--sunken); display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: 13px; text-align: center; padding: 8px; max-width: 100%; }
.slot .prev img { width: 100%; height: 100%; object-fit: cover; }
.slot .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot .acts .btn { padding: 12px 8px; }

.field { display: grid; gap: 6px; }
.field label { font-size: 13.5px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.field input, .field select, .field textarea { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 12px; min-width: 0; transition: border-color .15s ease-out, box-shadow .15s ease-out; }
.field input.num { font-family: var(--font-num); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.field.err input, .field.err select { border-color: var(--bad); }
.field .msg { font-size: 13px; color: var(--bad); }
.field .hint { font-size: 12.5px; color: var(--muted); }

.summary { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.summary div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); }
.summary div:first-child { border-top: 0; }
.summary dt { color: var(--muted); font-size: 13.5px; }
.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 14.5px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--coral); }
.done-num { font-family: var(--font-num); font-size: 28px; letter-spacing: .04em; color: var(--coral-deeper); }
.center { text-align: center; display: grid; gap: 12px; justify-items: center; }
.alert { border-radius: var(--r-sm); padding: 11px 13px; font-size: 13.5px; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.good { background: var(--good-soft); color: var(--good); }
@media (prefers-reduced-motion: reduce) { .progress i { transition: none; } .btn, .field input { transition: none; } }

/* ---------- 관리자 (PC) ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.login { max-width: 400px; width: 100%; margin: 24px auto; padding: 28px; display: grid; gap: 16px; background: var(--raised); }
.login h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.login h2 em { font-style: normal; color: var(--coral); }
.login .box b { font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; color: var(--muted); font-size: 14.5px; font-weight: 500; padding: 15px 12px 13px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--coral); }
.tabs .count { font-family: var(--font-num); font-size: 11px; color: var(--faint); margin-left: 5px; }
.tab-body { padding: 20px; display: grid; gap: 16px; }
.note { font-size: 13px; color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 880px) { .admin-grid { grid-template-columns: minmax(0, 1fr); } }
.listbox { display: grid; gap: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--raised); color: var(--muted); font-size: 13px; font-weight: 500; padding: 5px 12px; border-radius: 9999px; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--accent-ink); }
.search { width: 100%; font: inherit; font-size: 14.5px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--raised); color: var(--ink); }
.search:focus { outline: none; border-color: var(--ink); }
.sub-list { display: grid; gap: 6px; max-height: 620px; overflow-y: auto; }
.sub-row { text-align: left; border: 1px solid var(--line); background: var(--raised); color: var(--ink); border-radius: var(--r-sm); padding: 11px 13px; display: grid; gap: 3px; }
.sub-row:hover { border-color: var(--line-strong); }
.sub-row[aria-current="true"] { border-color: var(--coral); box-shadow: inset 3px 0 0 var(--coral); }
.sr-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sr-top b { margin-right: auto; }
.sr-meta { font-size: 12px; color: var(--faint); }
.del-due { color: var(--coral-deeper); font-weight: 700; }
.detail { border: 1px solid var(--line); background: var(--raised); border-radius: var(--r); padding: 20px; display: grid; gap: 20px; min-width: 0; }
.d-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.d-head h2 { font-size: 24px; font-weight: 800; margin-right: 6px; }
.sect { display: grid; gap: 10px; }
.sect-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.sect-h h3 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.kv div { padding: 10px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); display: grid; gap: 2px; min-width: 0; }
.kv dt { font-size: 12px; color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.doc { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; display: grid; }
.doc .img { aspect-ratio: 1.6; background: var(--sunken); display: grid; place-items: center; color: var(--muted); font-size: 12.5px; text-align: center; max-width: 100%; overflow: hidden; }
.doc .img button { all: unset; cursor: zoom-in; width: 100%; height: 100%; display: block; }
.doc .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox { position: fixed; inset: 0; z-index: 30; background: rgba(28, 28, 28, 0.82); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-sm); background: #fff; }
.doc span { font-size: 12.5px; padding: 7px 10px; border-top: 1px solid var(--line); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.asg-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: end; background: var(--sunken); border-radius: var(--r-sm); padding: 12px; }
.asg-form .field input, .asg-form .field select { font-size: 14.5px; padding: 0 10px; height: 42px; }
.asg-form .field label, .asg-form .lbl { font-size: 12.5px; font-weight: 600; }
.asg-form .af-dates { grid-column: 1 / -1; }
.days { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.day { position: relative; cursor: pointer; }
.day input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day span { display: inline-block; font-family: var(--font-num); font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9999px; background: var(--raised); color: var(--ink); }
.day input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--accent-ink); }
.day input:focus-visible + span { outline: 2px solid var(--coral); outline-offset: 2px; }
.day.off { cursor: not-allowed; }
.day.off span { color: var(--muted); background: var(--sunken); text-decoration: line-through; }
.pay-sel { font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); color: var(--ink); }
.pay-sel.pay-입금완료 { border-color: var(--good, #2e7d32); }
.pay-sel.pay-확정 { border-color: var(--coral); }
@media (max-width: 1040px) { .asg-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .asg-form .btn { grid-column: 1 / -1; } }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--raised); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
td.wrap { white-space: normal; min-width: 280px; }
th { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--surface); }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
tfoot td { font-weight: 700; background: var(--surface); }
td select { font: inherit; font-size: 13.5px; padding: 5px 6px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--raised); color: var(--ink); }
.settle-grid { display: grid; gap: 14px; }
.settle { border: 1px solid var(--line); background: var(--raised); border-radius: var(--r); padding: 18px; display: grid; gap: 12px; }
.settle-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.settle-h h3 { font-size: 18px; font-weight: 800; }
.stats { display: flex; gap: 6px; flex-wrap: wrap; }
.confirm { border: 1px solid var(--bad); background: var(--bad-soft); border-radius: var(--r-sm); padding: 14px; display: grid; gap: 10px; }
.confirm ul { margin: 0; padding-left: 18px; }
.textarea { width: 100%; font: inherit; font-size: 14.5px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--raised); color: var(--ink); min-height: 76px; resize: vertical; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--accent-ink); padding: 11px 18px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; z-index: 20; max-width: calc(100% - 32px); box-shadow: 0 8px 32px rgba(0,0,0,0.11); }
