:root {
  --bg: #faf7f2; --card: #ffffff; --ink: #231f1b; --muted: #8a8178; --line: #ece6dd;
  --brand: #e8590c; --brand-d: #c94a05; --brand-soft: #fff1e6;
  --ok: #2f9e44; --warn: #f59f00; --bad: #e03131; --blue: #1c7ed6;
  --shadow: 0 1px 2px rgba(35,31,27,.05), 0 8px 24px rgba(35,31,27,.07);
  --r: 18px;
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: 15px;
  background: var(--brand); color: #fff; transition: transform .12s, background .15s, box-shadow .15s;
}
.btn:hover { background: var(--brand-d); box-shadow: 0 6px 16px rgba(232,89,12,.28); }
.btn:active { transform: scale(.97); }
.btn:disabled { background: #d9d2c8; box-shadow: none; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #f6f1ea; box-shadow: none; }
.btn.danger { background: #fff; color: var(--bad); border: 1px solid #f3c9c9; }
.btn.danger:hover { background: #fff0f0; box-shadow: none; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; padding: 15px; font-size: 16px; border-radius: 14px; }

input, textarea, select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  outline: none; transition: border .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
label.f { display: block; font-size: 13px; font-weight: 700; color: #5c544c; margin: 14px 0 6px; }
textarea { resize: vertical; min-height: 76px; }

/* ===== 고객 페이지 ===== */
.hero {
  background: radial-gradient(1200px 400px at 80% -10%, #ffd8a8 0%, transparent 60%),
              linear-gradient(135deg, #fff4e6, #ffe8cc);
  padding: 56px 0 44px; border-bottom: 1px solid var(--line);
}
.hero .tag { display: inline-block; background: #fff; color: var(--brand); font-weight: 800; font-size: 12px; letter-spacing: .06em; padding: 6px 12px; border-radius: 99px; box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(30px, 6vw, 46px); line-height: 1.2; margin: 16px 0 10px; letter-spacing: -.03em; font-weight: 900; }
.hero p { color: #6b6258; font-size: 16px; }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 22px 0 6px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; padding: 9px 16px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-weight: 700; font-size: 14px; color: #6b6258; transition: .15s; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; padding: 18px 0 140px; }
.card { background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; animation: up .4s both; }
.card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(35,31,27,.05), 0 16px 36px rgba(35,31,27,.12); }
@keyframes up { from { opacity: 0; transform: translateY(12px); } }
.thumb { aspect-ratio: 4/3; background: linear-gradient(135deg, #fff1e6, #ffe3cc); display: grid; place-items: center; font-size: 68px; position: relative; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.soldout-badge { position: absolute; inset: 0; background: rgba(35,31,27,.55); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; letter-spacing: .1em; }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cat { font-size: 12px; font-weight: 800; color: var(--brand); }
.card h3 { font-size: 18px; letter-spacing: -.02em; }
.card .desc { font-size: 13.5px; color: var(--muted); flex: 1; }
.card .row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.price { font-size: 19px; font-weight: 900; }
.price small { font-weight: 600; font-size: 13px; }

.stepper { display: inline-flex; align-items: center; background: #f6f1ea; border-radius: 12px; }
.stepper button { width: 36px; height: 36px; font-size: 20px; font-weight: 700; border-radius: 12px; }
.stepper button:hover { background: #ece4d8; }
.stepper span { min-width: 26px; text-align: center; font-weight: 800; }

.cartbar { position: fixed; left: 0; right: 0; bottom: 0; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: rgba(250,247,242,.85); backdrop-filter: blur(14px); border-top: 1px solid var(--line); transform: translateY(110%); transition: transform .3s cubic-bezier(.2,.9,.3,1); z-index: 20; }
.cartbar.show { transform: none; }
.cartbar .in { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cartbar .sum b { font-size: 20px; }
.cartbar .sum span { color: var(--muted); font-size: 13px; display: block; }

.overlay { position: fixed; inset: 0; background: rgba(35,31,27,.5); z-index: 40; display: none; align-items: flex-end; justify-content: center; backdrop-filter: blur(3px); }
.overlay.show { display: flex; }
.sheet { background: #fff; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; border-radius: 26px 26px 0 0; padding: 26px 24px calc(24px + env(safe-area-inset-bottom)); animation: slide .3s cubic-bezier(.2,.9,.3,1); }
@media (min-width: 640px) { .overlay { align-items: center; } .sheet { border-radius: 26px; } }
@keyframes slide { from { transform: translateY(40px); opacity: 0; } }
.sheet h2 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 4px; }
.lines { margin: 14px 0 4px; border: 1px solid var(--line); border-radius: 14px; }
.line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; }
.line + .line { border-top: 1px solid var(--line); }
.line .nm { font-weight: 700; font-size: 14.5px; }
.line .sub { font-size: 12.5px; color: var(--muted); }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 2px 6px; font-weight: 800; }
.total b { font-size: 24px; color: var(--brand); }

.done { text-align: center; padding: 20px 0 6px; }
.done .ck { width: 76px; height: 76px; border-radius: 50%; background: #ebfbee; color: var(--ok); display: grid; place-items: center; font-size: 38px; margin: 0 auto 16px; animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.empty { text-align: center; color: var(--muted); padding: 80px 0; grid-column: 1/-1; }
footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 0 0 110px; }
footer a { color: inherit; }

/* ===== 관리자 ===== */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top .in { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.logo { font-weight: 900; font-size: 18px; letter-spacing: -.02em; }
.logo i { font-style: normal; color: var(--brand); }
.nav { display: flex; gap: 4px; background: #f6f1ea; padding: 4px; border-radius: 12px; }
.nav button { padding: 8px 16px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--muted); position: relative; }
.nav button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.dot { background: var(--bad); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: inline-grid; place-items: center; padding: 0 5px; margin-left: 6px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .box { background: #fff; padding: 36px 30px; border-radius: 24px; box-shadow: var(--shadow); width: 100%; max-width: 380px; text-align: center; }
.login .box h1 { font-size: 24px; margin-bottom: 6px; }
.login .box p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.err { color: var(--bad); font-size: 13px; margin-top: 10px; min-height: 18px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; padding: 24px 0 8px; }
.stat { background: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); }
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.stat b { display: block; font-size: 26px; margin-top: 2px; letter-spacing: -.02em; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 0; }

.orders { display: grid; gap: 14px; padding-bottom: 60px; }
.order { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; border-left: 5px solid var(--line); animation: up .35s both; }
.order.new { border-left-color: var(--bad); }
.order.confirmed { border-left-color: var(--blue); }
.order.done { border-left-color: var(--ok); }
.order.canceled { border-left-color: #adb5bd; opacity: .7; }
.order .head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.order .no { font-weight: 900; font-size: 17px; }
.order .time { color: var(--muted); font-size: 13px; margin-left: 8px; font-weight: 500; }
.badge { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px; }
.badge.new { background: #fff0f0; color: var(--bad); }
.badge.confirmed { background: #e7f5ff; color: var(--blue); }
.badge.done { background: #ebfbee; color: var(--ok); }
.badge.canceled { background: #f1f3f5; color: #868e96; }
.order .cust { margin: 10px 0; font-size: 14.5px; display: grid; gap: 2px; }
.order .cust .m { background: #fff9db; border-radius: 10px; padding: 8px 12px; margin-top: 6px; font-size: 13.5px; }
.order .items { border-top: 1px dashed var(--line); padding-top: 10px; font-size: 14.5px; }
.order .items div { display: flex; justify-content: space-between; padding: 3px 0; }
.order .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; flex-wrap: wrap; gap: 10px; }
.order .foot b { font-size: 20px; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; }

.ptable { display: grid; gap: 10px; padding: 18px 0 60px; }
.prow { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 14px; background: #fff; border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow); }
.prow .pi { width: 64px; height: 64px; border-radius: 14px; background: #fff1e6; display: grid; place-items: center; font-size: 30px; overflow: hidden; }
.prow .pi img { width: 100%; height: 100%; object-fit: cover; }
.prow h4 { font-size: 16px; }
.prow .meta { font-size: 13px; color: var(--muted); }
.tag2 { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; margin-left: 6px; }
.tag2.so { background: #fff0f0; color: var(--bad); }
.tag2.hd { background: #f1f3f5; color: #868e96; }
.bar { display: flex; justify-content: space-between; align-items: center; padding-top: 22px; }
.bar h2 { font-size: 20px; }
.imgrow { display: flex; gap: 12px; align-items: center; }
.imgrow .pv { width: 72px; height: 72px; border-radius: 14px; background: #fff1e6; display: grid; place-items: center; font-size: 32px; overflow: hidden; flex: none; }
.imgrow .pv img { width: 100%; height: 100%; object-fit: cover; }
.checks { display: flex; gap: 18px; margin-top: 14px; }
.checks label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.checks input { width: 18px; height: 18px; accent-color: var(--brand); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toast { position: fixed; top: 20px; left: 50%; transform: translate(-50%, -80px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 14px; font-weight: 700; z-index: 99; transition: transform .35s cubic-bezier(.2,.9,.3,1); box-shadow: var(--shadow); }
.toast.show { transform: translate(-50%, 0); }
@media (max-width: 560px) {
  .prow { grid-template-columns: 52px 1fr; } .prow .pi { width: 52px; height: 52px; } .prow .acts { grid-column: 1/-1; }
  .top .in { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 8px; }
}

/* ===== 회원 ===== */
.usernav { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.usernav .who { font-size: 14px; }
.ustat { font-size: 11.5px; font-weight: 800; padding: 4px 10px; border-radius: 99px; }
.ustat.pending { background: #fff4e6; color: var(--brand); }
.ustat.approved { background: #ebfbee; color: var(--ok); }
.ustat.blocked { background: #fff0f0; color: var(--bad); }
.seg { display: flex; background: #f6f1ea; padding: 4px; border-radius: 12px; margin: 14px 0 2px; }
.seg button { flex: 1; padding: 9px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.urow { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.urow h4 { font-size: 16px; }
.urow .meta { font-size: 13px; color: var(--muted); }

.ustat.grade { background: #f3f0ff; color: #6741d9; }
.gp { display: inline-block; font-size: 11.5px; font-weight: 700; background: #f3f0ff; color: #6741d9; border-radius: 99px; padding: 1px 8px; margin: 0 4px 2px 0; }
.four { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.four .gl { display: block; font-size: 11.5px; font-weight: 800; color: #6741d9; margin-bottom: 4px; }
.four input { padding: 10px 8px; }
.gsel { width: auto; padding: 7px 10px; border-radius: 9px; font-size: 13px; font-weight: 700; }
@media (max-width: 420px) { .four { grid-template-columns: repeat(2, 1fr); } }

/* ===== 첫 화면(로그인) ===== */
#gate { display: none; }
body.gated #gate { display: grid; }
body.gated .hero, body.gated main, body.gated footer, body.gated .cartbar { display: none; }
#gate { min-height: 100vh; place-items: center; padding: 24px 20px;
  background: radial-gradient(1000px 500px at 85% -10%, #ffd8a8 0%, transparent 60%), linear-gradient(135deg, #fff4e6, #ffe8cc); }
.gbox { background: #fff; width: 100%; max-width: 420px; padding: 34px 30px 30px; border-radius: 26px; box-shadow: 0 2px 4px rgba(35,31,27,.05), 0 24px 60px rgba(35,31,27,.14); animation: up .45s both; }
.gbox .tag { display: inline-block; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 12px; letter-spacing: .06em; padding: 6px 12px; border-radius: 99px; }
.gbox h1 { font-size: 28px; letter-spacing: -.03em; margin: 14px 0 6px; font-weight: 900; }
.gsub { color: var(--muted); font-size: 14px; }
.gbox.done { text-align: center; }
.gbox.done .ck { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; margin: 0 auto 8px; animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
.gbox.done .gsub { margin: 8px 0 22px; }

/* ===== 주문 내역 표 ===== */
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin-top: 4px; }
.otbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; font-variant-numeric: tabular-nums; }
.otbl th { background: #f6f1ea; font-size: 12.5px; color: #5c544c; font-weight: 800; padding: 9px 12px; text-align: right; white-space: nowrap; }
.otbl td { padding: 10px 12px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
.otbl .l { text-align: left; }
.otbl td.l:first-child { font-weight: 700; white-space: normal; }
.otbl td.memo { white-space: normal; color: #6b6258; min-width: 120px; max-width: 220px; }
.otbl tfoot td { background: #faf7f2; font-weight: 800; border-top: 2px solid var(--line); }
.order .items { display: none; }
