/* 굿즈모닝 관리 프로그램: 왼쪽 메뉴 + 오른쪽 작업 화면. 휴대폰에서는 메뉴가 아래 탭으로 바뀜 */
:root {
  --bg: #f5f8fc;
  --panel: #ffffff;
  --ink: #17233d;
  --muted: #5d6880;
  --line: #dde5ef;
  --side: #17233d;
  --side-ink: #c9d3e3;
  --sun: #ffc93c;
  --sun-soft: #fff4d4;
  --display: "Jua", "IBM Plex Sans KR", "Malgun Gothic", sans-serif;
  --body: "IBM Plex Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.6; }
h1, h2 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1.25; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 8px; }

.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100%; }

/* 왼쪽 메뉴 */
.side { background: var(--side); color: var(--side-ink); padding: 20px 14px; display: grid; align-content: start; gap: 26px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand img { border-radius: 50%; background: #fff; }
.brand strong { display: block; color: #fff; font-family: var(--display); font-weight: 400; font-size: 1.3rem; line-height: 1.1; }
.brand span { font-size: .78rem; }
#nav { display: grid; gap: 4px; }
#nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: inherit; text-decoration: none; font-weight: 500; }
#nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
#nav a[aria-current="page"] { background: var(--sun); color: var(--ink); }
#nav svg { width: 20px; height: 20px; flex: none; }
#nav .count { margin-left: auto; font-size: .75rem; opacity: .7; }

/* 작업 화면 */
.main { padding: 32px clamp(16px, 4vw, 48px) 48px; display: grid; gap: 24px; align-content: start; outline: none; }
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
.head h1 { font-size: 2rem; }
.head p { margin: 4px 0 0; color: var(--muted); }
.btn { font: 700 .9rem var(--body); border: 0; border-radius: 999px; padding: 10px 18px; background: var(--ink); color: #fff; cursor: pointer; }
.btn[disabled] { opacity: .35; cursor: not-allowed; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; }

.empty { background: var(--panel); border: 1.5px dashed var(--line); border-radius: 20px; padding: 40px 24px; display: grid; justify-items: center; text-align: center; gap: 10px; }
.empty .ic { width: 64px; height: 64px; border-radius: 20px; background: var(--sun-soft); display: grid; place-items: center; }
.empty .ic svg { width: 30px; height: 30px; }
.empty h2 { font-size: 1.35rem; }
.empty p { margin: 0; color: var(--muted); max-width: 32em; }

.plan { background: var(--panel); border: 1.5px solid var(--line); border-radius: 20px; padding: 20px 24px; display: grid; gap: 10px; }
.plan h2 { font-size: 1.1rem; }
.plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.plan li { display: flex; gap: 10px; color: var(--muted); }
.plan li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); margin-top: .6em; }

/* 휴대폰: 아래 탭 메뉴 */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: auto 0 0 0; height: auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 10; }
  .brand { display: none; }
  #nav { grid-template-columns: repeat(5, 1fr); gap: 2px; }
  #nav a { flex-direction: column; gap: 2px; padding: 8px 4px; font-size: .75rem; }
  #nav .count { display: none; }
  .main { padding-bottom: 96px; padding-top: 20px; }
  .head h1 { font-size: 1.6rem; }
}

/* 판매처 연결 상태 */
.conn { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: var(--panel); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 16px; font-size: .92rem; }
.conn .dot { width: 10px; height: 10px; border-radius: 50%; background: #b8c2d3; flex: none; }
.conn.ok .dot { background: #1fa45a; }
.conn.warn { background: #fff8e3; border-color: #f2d78a; }
.conn.warn .dot { background: #e0a100; }
.conn.bad { background: #fff1ef; border-color: #f3c2ba; }
.conn.bad .dot { background: #d6452f; }
.conn > span:nth-child(2) { flex: 1; min-width: 0; }
.conn .later { color: var(--muted); font-size: .82rem; }

/* 주문 표 */
.table-wrap { background: var(--panel); border: 1.5px solid var(--line); border-radius: 16px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: .82rem; background: #f8fafd; }
tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); font-size: .8rem; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #eef2f7; color: var(--muted); }
.pill.s-PAYED { background: var(--sun); color: var(--ink); }
.pill.s-DELIVERING { background: #dbeeff; color: #1b5e9e; }
.pill.s-DELIVERED, .pill.s-PURCHASE_DECIDED { background: #dcf3e6; color: #17703f; }
.pill.s-CANCELED, .pill.s-RETURNED, .pill.s-CANCELED_BY_NOPAYMENT { background: #fde6e2; color: #a8321f; }

/* 기간 선택 · 지금 확인 */
.periods { display: flex; flex-wrap: wrap; gap: 6px; }
.periods button { font: 500 .88rem var(--body); color: var(--muted); background: var(--panel); border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.periods button:hover { color: var(--ink); }
.periods button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-mini { font: 700 .8rem var(--body); background: var(--bg); color: var(--ink); border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.btn-mini[disabled] { opacity: .5; }
.conn em { font-style: normal; color: var(--muted); }

/* 시안: 상태 표시 */
.pill.d-sent { background: #dbeeff; color: #1b5e9e; }
.pill.d-revise { background: #fde6e2; color: #a8321f; }
.pill.d-confirmed { background: #dcf3e6; color: #17703f; }
a.pill { text-decoration: none; }
.bad-t { color: #a8321f; font-weight: 700; }
.msg { margin: 0; color: #a8321f; font-size: .9rem; }

/* 시안 올리기 창 */
.dlg { border: 0; border-radius: 20px; padding: 0; width: min(480px, calc(100vw - 32px)); color: var(--ink); box-shadow: 0 20px 60px rgba(23,35,61,.3); }
.dlg::backdrop { background: rgba(23,35,61,.45); }
.dlg-body { padding: 22px; display: grid; gap: 12px; }
.dlg-body h2 { font-size: 1.35rem; }
.dlg-body p { margin: 0; overflow-wrap: anywhere; }
.drop { display: grid; gap: 10px; justify-items: center; text-align: center; border: 2px dashed var(--line); border-radius: 16px; padding: 18px; cursor: pointer; color: var(--muted); }
.drop:hover { border-color: var(--ink); }
.drop input { width: 100%; font: inherit; }
.drop img { max-width: 100%; max-height: 260px; border-radius: 10px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 18px; height: 18px; }
.dlg-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.dlg-actions a.btn-mini { text-decoration: none; }

/* 시안 목록 · 상세 */
.drafts { display: grid; gap: 16px; }
tr.pick { cursor: pointer; }
tr.pick:hover td { background: #f8fafd; }
tr.pick.on td { background: var(--sun-soft); }
.detail { background: var(--panel); border: 1.5px solid var(--line); border-radius: 20px; padding: 20px; display: grid; gap: 14px; }
.detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; }
.detail-head h2 { font-size: 1.35rem; }
.detail-head p { margin: 2px 0 0; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.detail-actions a.btn-mini { text-decoration: none; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(240px, 2fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.mk { position: relative; border-radius: 14px; overflow: hidden; border: 1.5px solid var(--line); background: repeating-conic-gradient(#eef3f9 0 25%, #fff 0 50%) 0 0 / 20px 20px; }
.mk img { display: block; width: 100%; height: auto; }
.mk canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mk-pins { position: absolute; inset: 0; pointer-events: none; }
.mk-pin { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: #e5332a; color: #fff; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); font-size: .8rem; font-weight: 700; display: grid; place-items: center; }
.fbs { display: grid; gap: 10px; }
.fb { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 6px; }
.fb.ok { background: #dcf3e6; border-color: #b5e2c7; color: #17703f; }
.fb-pins { margin: 0; padding: 0; list-style: none; counter-reset: pin; display: grid; gap: 6px; }
.fb-pins li { counter-increment: pin; display: grid; grid-template-columns: 24px 1fr; gap: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-pins li::before { content: counter(pin); width: 24px; height: 24px; border-radius: 50%; background: #e5332a; color: #fff; font-size: .75rem; font-weight: 700; display: grid; place-items: center; }
.fb-note { margin: 0; background: var(--bg); border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* CS: 문의 게시판 */
.board { display: grid; gap: 16px; }
table.posts td.ttl { white-space: normal; min-width: 220px; max-width: 460px; }
tr.unread td.ttl { font-weight: 700; }
.src { display: inline-block; font-size: .78rem; font-weight: 700; padding: 1px 8px; border-radius: 6px; }
.src-hp { background: var(--sun-soft); color: #8a4b00; }
.src-nv { background: #dcf7e8; color: #02803f; }
.pill.c-new { background: var(--sun); color: var(--ink); }
.pill.c-doing { background: #dbeeff; color: #1b5e9e; }
.pill.c-done { background: #dcf3e6; color: #17703f; }
.post { background: var(--panel); border: 1.5px solid var(--line); border-radius: 20px; padding: 22px; display: grid; gap: 16px; }
.post header { display: grid; gap: 2px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.post header h2 { font-size: 1.35rem; overflow-wrap: anywhere; }
.post header p { margin: 0; }
.fields { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; background: var(--bg); border-radius: 14px; padding: 14px 16px; }
.fields dt { color: var(--muted); font-size: .88rem; }
.fields dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1rem; line-height: 1.75; }
.answer { border-left: 4px solid #1fa45a; background: #f1faf4; border-radius: 0 12px 12px 0; padding: 12px 14px; display: grid; gap: 6px; justify-items: start; }
.answer.wait { border-color: #e0a100; background: #fff8e3; }
.answer p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.answer a.btn-mini { text-decoration: none; }
.handle { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; }
.handle .periods button[disabled] { opacity: .4; cursor: not-allowed; }
.handle textarea { width: 100%; font: inherit; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg); resize: vertical; }
.lb { font-weight: 700; font-size: .92rem; }
.reply { display: grid; gap: 8px; background: var(--sun-soft); border-radius: 14px; padding: 14px 16px; }
.reply textarea { width: 100%; font: inherit; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; resize: vertical; }
.reply p { margin: 0; font-size: .85rem; }
.reply .msg { margin-right: auto; }
.reply .btn[disabled], .reply .btn-mini[disabled] { opacity: .4; cursor: not-allowed; }
