@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --blue500: #3182f6;
  --blue600: #2272eb;
  --blue50: #f2f8ff;
  --blue100: #e8f3ff;
  --grey900: #191f28;
  --grey800: #333d4b;
  --grey700: #4e5968;
  --grey600: #6b7684;
  --grey500: #8b95a1;
  --grey400: #b0b8c1;
  --grey300: #d1d6db;
  --grey200: #e5e8eb;
  --grey100: #f2f4f6;
  --grey50: #f9fafb;
  --red: #f04452;
  --red50: #fff0f1;
  --green: #03b26c;
  --green50: #e9f9f1;
  --orange: #fe9800;
  --orange50: #fff5e6;
  --radius: 16px;
  --display: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grey50);
  color: var(--grey900);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  word-break: keep-all;
}
a { color: var(--blue500); text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; line-height: 1.3; }
[hidden] { display: none !important; }

/* ── 상단바 ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--grey200);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--grey900); }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--blue500);
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800;
}
.brand small { font-weight: 500; color: var(--grey500); font-size: 13px; }
.topbar .spacer { flex: 1; }
.who { font-size: 14px; color: var(--grey700); }
.who b { color: var(--grey900); font-weight: 600; }

.tabs { display: flex; gap: 4px; max-width: 1120px; margin: 0 auto; padding: 0 12px; overflow-x: auto; }
.tab {
  border: 0; background: none; padding: 12px 10px; font-size: 15px; font-weight: 600; color: var(--grey500);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab.on { color: var(--grey900); border-bottom-color: var(--grey900); }
.tab .badge { margin-left: 4px; }

main { max-width: 1120px; margin: 0 auto; padding: 28px 20px 120px; }

/* ── 공통 ── */
.card { background: #fff; border: 1px solid var(--grey200); border-radius: var(--radius); padding: 24px; }
.kicker { font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--blue500); letter-spacing: 0.02em; margin-bottom: 6px; }
.title { font-size: 26px; font-weight: 800; }
.sub { color: var(--grey600); margin-top: 6px; }
.section-head { margin-bottom: 20px; }
.muted { color: var(--grey500); }
.small { font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 12px; padding: 0 18px; height: 44px;
  font-weight: 600; font-size: 15px; background: var(--grey100); color: var(--grey800);
  transition: background 0.15s, opacity 0.15s;
}
.btn:hover { background: var(--grey200); }
.btn.primary { background: var(--blue500); color: #fff; }
.btn.primary:hover { background: var(--blue600); }
.btn.light { background: var(--blue100); color: var(--blue600); }
.btn.light:hover { background: #d9ebff; }
.btn.danger { background: var(--red50); color: var(--red); }
.btn.ghost { background: none; color: var(--grey600); padding: 0 10px; }
.btn.ghost:hover { background: var(--grey100); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.lg { height: 54px; font-size: 17px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; background: var(--grey100); color: var(--grey700); white-space: nowrap;
}
.badge.received { background: var(--orange50); color: #c76f00; }
.badge.confirmed { background: var(--blue100); color: var(--blue600); }
.badge.in_progress { background: var(--blue500); color: #fff; }
.badge.done { background: var(--green50); color: #028a54; }
.badge.canceled { background: var(--grey100); color: var(--grey500); text-decoration: line-through; }
.badge.pending { background: var(--orange50); color: #c76f00; }
.badge.approved { background: var(--green50); color: #028a54; }
.badge.rejected { background: var(--red50); color: var(--red); }
.badge.count { background: var(--red); color: #fff; height: 18px; padding: 0 6px; font-size: 11px; border-radius: 9px; }

/* ── 폼 ── */
.field { margin-bottom: 20px; }
.field > label, .field > .label { display: block; font-size: 14px; font-weight: 600; color: var(--grey700); margin-bottom: 8px; }
.field .req { color: var(--blue500); margin-left: 2px; }
.field .hint { font-size: 13px; color: var(--grey500); margin-top: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.input, select.input, textarea.input {
  width: 100%; height: 50px; border: 1px solid var(--grey200); border-radius: 12px;
  padding: 0 14px; font: inherit; font-size: 16px; color: var(--grey900); background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:focus { outline: none; border-color: var(--blue500); box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.15); }
.input.bad { border-color: var(--red); box-shadow: 0 0 0 3px rgba(240, 68, 82, 0.12); }
.input::placeholder { color: var(--grey400); }
select.input { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238B95A1' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 16px center; padding-right: 40px; }

.segment { display: flex; flex-wrap: wrap; gap: 8px; }
.segment label {
  flex: 1 1 auto; min-width: 120px; position: relative;
  border: 1px solid var(--grey200); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: #fff;
  font-weight: 600; color: var(--grey700); transition: border-color 0.15s, background 0.15s;
}
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment label:has(input:checked) { border-color: var(--blue500); background: var(--blue50); color: var(--blue600); }
.segment label:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.2); }

.price-opts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.price-opts label { text-align: center; padding: 14px 6px 12px; min-width: 0; }
.price-opts .p { display: block; font-family: var(--display); font-size: 19px; font-weight: 700; color: var(--grey900); }
.price-opts label:has(input:checked) .p { color: var(--blue600); }
.price-opts .h { display: block; font-size: 11.5px; font-weight: 500; color: var(--grey500); margin-top: 2px; line-height: 1.35; min-height: 16px; }

.check {
  display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--grey200); border-radius: 12px;
  padding: 14px; cursor: pointer; font-weight: 600; color: var(--grey800);
}
.field > label.check { display: flex; margin-bottom: 0; color: var(--grey800); font-size: 15px; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--blue500); flex: none; }
.check:has(input:checked) { border-color: var(--blue500); background: var(--blue50); }

.alert { border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.alert.error { background: var(--red50); color: #c4202e; }
.alert.info { background: var(--blue50); color: var(--grey800); }
.alert.warn { background: var(--orange50); color: #8a5300; }

/* ── 접수하기 ── */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 24px; }
.cat {
  text-align: left; background: #fff; border: 1px solid var(--grey200); border-radius: var(--radius);
  padding: 16px; transition: border-color 0.15s, background 0.15s;
}
.cat:hover { border-color: var(--grey300); }
.cat .n { display: block; font-family: var(--display); font-size: 17px; font-weight: 700; color: var(--grey900); }
.cat .t { display: block; font-size: 13px; color: var(--grey500); margin-top: 2px; }
.cat.on { border-color: var(--blue500); background: var(--blue50); }
.cat.on .n { color: var(--blue600); }

.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.notes { list-style: none; margin: 0 0 24px; padding: 16px 18px; background: var(--grey50); border-radius: 12px; display: grid; gap: 6px; }
.notes li { position: relative; padding-left: 14px; font-size: 14px; color: var(--grey700); }
.notes li::before { content: ''; position: absolute; left: 0; top: 10px; width: 4px; height: 4px; border-radius: 50%; background: var(--grey400); }

.summary { position: sticky; top: 124px; }
.summary h3 { font-size: 15px; font-weight: 600; color: var(--grey600); margin-bottom: 12px; font-family: inherit; }
.summary .product { font-family: var(--display); font-size: 20px; font-weight: 700; }
.summary .line { color: var(--grey600); font-size: 14px; margin-top: 4px; }
.sum-rows { margin: 18px 0; padding: 16px 0; border-top: 1px solid var(--grey100); border-bottom: 1px solid var(--grey100); display: grid; gap: 8px; }
.sum-rows div { display: flex; justify-content: space-between; font-size: 14px; color: var(--grey600); }
.sum-rows .total { color: var(--grey900); font-weight: 700; font-size: 15px; margin-top: 4px; }
.sum-rows .total span:last-child { font-family: var(--display); font-size: 24px; font-weight: 800; color: var(--blue600); }
.bank { font-size: 13.5px; color: var(--grey600); background: var(--grey50); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.bank b { color: var(--grey900); }

.mobile-bar { display: none; }

/* ── 목록 ── */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar .input { height: 40px; width: auto; font-size: 14px; border-radius: 10px; }
.toolbar select.input { padding-right: 34px; background-position: right 12px center; }
.toolbar .grow { flex: 1; min-width: 160px; }

.table-wrap { background: #fff; border: 1px solid var(--grey200); border-radius: var(--radius); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--grey500); font-size: 13px; padding: 12px 14px; background: var(--grey50); border-bottom: 1px solid var(--grey200); white-space: nowrap; }
td { padding: 14px; border-bottom: 1px solid var(--grey100); vertical-align: middle; }
tbody tr { cursor: pointer; transition: background 0.1s; }
tbody tr:hover { background: var(--grey50); }
tbody tr:last-child td { border-bottom: 0; }
td .main { font-weight: 600; color: var(--grey900); }
td .meta { font-size: 13px; color: var(--grey500); }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--grey300); }
.dot.on { background: var(--green); }

.empty { text-align: center; padding: 56px 20px; color: var(--grey500); }
.empty b { display: block; color: var(--grey800); font-size: 16px; margin-bottom: 4px; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--grey200); border-radius: var(--radius); padding: 16px 18px; text-align: left; }
button.stat:hover { border-color: var(--grey300); }
.stat .k { font-size: 13px; color: var(--grey500); font-weight: 600; }
.stat .v { font-family: var(--display); font-size: 26px; font-weight: 800; margin-top: 2px; }
.stat.hot .v { color: var(--blue600); }

/* ── 모달 / 서랍 ── */
.overlay { position: fixed; inset: 0; background: rgba(0, 12, 30, 0.45); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: auto; padding: 28px; }
.modal h2 { font-size: 22px; font-weight: 800; }
.overlay.drawer { justify-content: flex-end; padding: 0; align-items: stretch; }
.overlay.drawer .modal { max-width: 560px; max-height: none; height: 100%; border-radius: 0; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.modal-head > div { flex: 1; }
.close { border: 0; background: var(--grey100); width: 36px; height: 36px; border-radius: 10px; font-size: 20px; color: var(--grey600); flex: none; }

.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--grey500); }
.kv dd { margin: 0; color: var(--grey900); word-break: break-all; }
.block { margin-top: 24px; }
.block > h4 { font-size: 14px; font-weight: 700; color: var(--grey700); margin: 0 0 10px; }
.big-check { width: 64px; height: 64px; border-radius: 50%; background: var(--blue500); color: #fff; display: grid; place-items: center; font-size: 30px; margin: 4px auto 16px; }
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 80;
  background: var(--grey900); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500;
  max-width: calc(100% - 32px);
}

/* ── 로그인 ── */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  position: relative; overflow: hidden; isolation: isolate;
  /* 위쪽은 밝게, 아래로 갈수록 깊은 파랑 → 입체감 */
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(10, 40, 120, 0.55) 0%, rgba(10, 40, 120, 0) 60%),
    linear-gradient(155deg, #5aa2ff 0%, #3182f6 42%, #1f5fd6 78%, #1747b0 100%);
}
.auth-side::before {
  /* 은은한 빛 번짐 */
  content: ''; position: absolute; z-index: -1; width: 520px; height: 520px; left: -160px; bottom: -220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 195, 255, 0.45) 0%, rgba(140, 195, 255, 0) 70%);
}
.auth-side::after {
  content: ''; position: absolute; z-index: -1; right: -40px; top: -40px; width: 280px; height: 280px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.22) 2px, transparent 2px); background-size: 20px 20px;
}
.auth-side h1 {
  font-size: 46px; font-weight: 800; line-height: 1.2; letter-spacing: -0.035em;
  text-shadow: 0 2px 24px rgba(8, 30, 90, 0.25);
}
.auth-side .h1-sub {
  display: block; margin-bottom: 14px;
  font-size: 19px; font-weight: 600; line-height: 1.55; letter-spacing: -0.01em; color: rgba(255, 255, 255, 0.86);
  text-shadow: none;
}
.auth-side p { color: rgba(255, 255, 255, 0.82); font-size: 16px; margin-top: 14px; }
.auth-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.auth-side li { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.auth-side li span { width: 28px; height: 28px; border-radius: 8px; background: rgba(255, 255, 255, 0.16); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.auth-main { max-width: none; margin: 0; display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: #fff; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h2 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.auth-switch { margin-top: 18px; text-align: center; font-size: 14px; color: var(--grey600); }
.auth-switch button { border: 0; background: none; color: var(--blue500); font-weight: 600; padding: 0 4px; }
.optional-head { font-size: 13px; color: var(--grey500); margin: 4px 0 12px; padding-top: 16px; border-top: 1px solid var(--grey100); }

.pending-box { max-width: 520px; margin: 40px auto; text-align: center; }
.pending-box .icon { width: 64px; height: 64px; border-radius: 50%; background: var(--orange50); color: var(--orange); font-size: 28px; display: grid; place-items: center; margin: 0 auto 16px; }

/* ── 반응형 ── */
@media (max-width: 980px) {
  .cats { grid-template-columns: repeat(3, 1fr); }
  .order-grid { grid-template-columns: 1fr; }
  .summary-card { display: none; }
  .mobile-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: 12px; align-items: center;
    background: #fff; border-top: 1px solid var(--grey200); padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }
  .mobile-bar .amt { flex: 1; min-width: 0; }
  .mobile-bar .amt small { display: block; font-size: 12px; color: var(--grey500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mobile-bar .amt b { font-family: var(--display); font-size: 20px; color: var(--blue600); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 20px 32px; gap: 32px; }
  .auth-side h1 { font-size: 34px; }
  .auth-side .h1-sub { font-size: 16px; margin-bottom: 10px; }
  .auth-side ul { margin: 24px 0 28px; }
}
@media (max-width: 640px) {
  main { padding: 20px 16px 120px; }
  .topbar-inner { padding: 0 16px; }
  .brand small, .who { display: none; }
  .cats { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 20px 16px; }
  .price-opts { grid-template-columns: repeat(3, 1fr); }
  .row2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .title { font-size: 22px; }
  .kv { grid-template-columns: 96px 1fr; }
  .modal { padding: 22px 18px; }
}
