/* 간편 화면 — 폰 우선, 넓은 화면에서는 왼쪽 메뉴.
   모양은 미용실 포스트메이커와 같은 계열로 맞춘다(흰 카드에 옅은 테두리·그림자, 알약 모양 탭·배지). 색은 스탭의 청록 계열을 그대로 쓴다. */
:root {
  --bg: #f4f6f4;
  --card: #ffffff;
  --ink: #1b2421;
  --mute: #66736f;
  --line: #e2e7e4;
  --brand: #1f6f64;
  --brand-dark: #17574e;
  --brand-soft: #e3f1ee;
  --ok: #17574e;
  --ok-soft: #e3f1ee;
  --warn: #a85a12;
  --warn-soft: #fbefdf;
  --danger: #b93a2c;
  --danger-soft: #fbe9e6;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05);
  --tabs-h: 62px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 Arial, Helvetica, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.mute { color: var(--mute); }
.small { font-size: 13px; }
@media (max-width: 640px) { body { font-size: 15px; } }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide { display: none !important; }

/* ── 뼈대 ── */
.top {
  position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line);
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 10px; min-height: 54px;
}
.top h1 { font-size: 18px; font-weight: 700; }
.top .back { font-size: 22px; margin-left: -6px; padding: 4px 6px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer;
}
.icon-btn:active { background: var(--bg); }
.classic-link {
  flex: none; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; background: var(--brand); color: #fff;
}
.classic-link:active { opacity: .85; }
/* 운영자가 매장 화면에 들어왔을 때 상단 오른쪽에 나오는 돌아가기 버튼 */
.admin-link {
  flex: none; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; background: #374151; color: #fff;
}
.admin-link:active { opacity: .85; }
main { padding: 14px 14px calc(var(--tabs-h) + 28px + env(safe-area-inset-bottom)); max-width: 1080px; margin: 0 auto; }
main.has-bar { padding-bottom: calc(var(--tabs-h) + 110px + env(safe-area-inset-bottom)); }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card);
  border-top: 1px solid var(--line); display: flex; height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--mute);
}
.tabs a i { font-size: 21px; }
.tabs a.on { color: var(--brand); font-weight: 700; }
.tabs a.plus i {
  width: 44px; height: 44px; margin-top: -18px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: 0 4px 12px rgba(31,111,100,.35);
}
.tabs a.plus { color: var(--brand); font-weight: 700; }
.side { display: none; }

@media (min-width: 900px) {
  body { padding-left: 216px; }
  .tabs { display: none; }
  .side {
    display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: 216px;
    background: var(--card); border-right: 1px solid var(--line); padding: 18px 12px; gap: 4px; z-index: 40;
  }
  .side .brand { font-weight: 800; font-size: 19px; padding: 6px 12px 16px; color: var(--brand); }
  .side a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; font-size: 15px; font-weight: 600; color: #4b5563; }
  .side a i { font-size: 19px; }
  .side a:hover { background: #f3f4f6; color: var(--brand); }
  .side a.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
  .side a.to-classic, .side a.to-classic:hover { background: var(--brand); color: #fff; border-radius: 12px; margin-bottom: 6px; }
  .side .spacer { flex: 1; }
  main, main.has-bar { padding: 22px 26px 120px; }
  .top { padding: 12px 26px; }
  .top .more-link, .top .classic-link { display: none; }
  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  .cols-wide { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
  .paybar { left: 216px !important; bottom: 0 !important; }
}

/* ── 카드·목록 ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card > h2, .sec { font-size: 15px; font-weight: 700; color: #374151; margin: 0 0 10px; }
.sec { margin: 18px 2px 8px; display: flex; align-items: center; justify-content: space-between; }
.sec a { color: var(--brand); font-weight: 600; font-size: 13px; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; box-shadow: var(--shadow); }
.list > * { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-top: 1px solid var(--line); }
.list > *:first-child { border-top: 0; }
.list > a:active { background: var(--bg); }
.list .t { font-weight: 600; }
.list .chev { color: #d1d5db; }
.empty { text-align: center; color: var(--mute); padding: 26px 10px; font-size: 14px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: block; box-shadow: var(--shadow); }
.stat .k { font-size: 13px; color: var(--mute); }
.stat .v { font-size: 22px; font-weight: 800; letter-spacing: -.3px; margin-top: 2px; }
.stat .v small { font-size: 13px; font-weight: 600; }
.stat .s { font-size: 12px; color: var(--mute); margin-top: 2px; }
.stat.hero { background: var(--brand); border-color: var(--brand); color: #fff; }
.stat.hero .k, .stat.hero .s { color: rgba(255,255,255,.82); }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; }
.kv + .kv { border-top: 1px dashed var(--line); }
.kv b { font-weight: 700; }
.kv.total { font-size: 17px; border-top: 1px solid var(--ink); margin-top: 4px; padding-top: 10px; }

.bar-row { padding: 9px 0; }
.bar-row + .bar-row { border-top: 1px dashed var(--line); }
.bar { height: 6px; border-radius: 3px; background: #f3f4f6; margin-top: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }

/* ── 버튼·입력 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 16px;
  border-radius: 12px; border: 1px solid #cfd7d3; background: var(--card); color: var(--ink); font-weight: 700; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f9fafb; }
.btn.primary:hover { background: var(--brand-dark); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.soft { background: var(--brand-soft); border-color: #b9dcd5; color: var(--brand-dark); }
.btn.danger { color: var(--danger); border-color: #efc9c3; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.actions .btn { min-height: 54px; font-size: 16px; }

label.f { display: block; font-size: 13px; font-weight: 600; color: var(--mute); margin: 12px 0 5px; }
.in, select.in, textarea.in {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cfd7d3; border-radius: 12px; background: #fff;
  font-size: 16px; /* 16px 미만이면 아이폰이 입력할 때 화면을 확대한다 */
  -webkit-appearance: none; appearance: none;
}
select.in {
  background-image: 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='%236b7280' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
textarea.in { min-height: 76px; resize: vertical; }
.in:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.in.money { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent; background: #f3f4f6; color: #4b5563;
  font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { background: #e5e7eb; }
.chip.on:hover { background: var(--brand-dark); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.open { background: var(--brand-soft); color: var(--brand-dark); }
.badge.now { background: var(--warn-soft); color: var(--warn); }
.badge.done { background: #f3f4f6; color: var(--mute); }
.badge.off { background: var(--danger-soft); color: var(--danger); }
.badge.naver { background: #03c75a; color: #fff; font-size: 11px; padding: 1px 6px; vertical-align: 1px; }
.badge.gold { background: var(--warn-soft); color: var(--warn); }

.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.bad { background: var(--danger-soft); color: var(--danger); }

/* ── 예약 ── */
.days { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: none; width: 50px; padding: 7px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  text-align: center; font-size: 12px; color: var(--mute);
}
.day b { display: block; font-size: 17px; color: var(--ink); }
.day .c { font-size: 11px; color: var(--brand); font-weight: 700; min-height: 16px; }
.day.sun b { color: var(--danger); }
.day.today { border-color: var(--brand); }
.day.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.day.on b, .day.on .c { color: #fff; }

.res { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.res .body { display: flex; gap: 12px; padding: 13px 14px; cursor: pointer; }
.res .time { width: 52px; flex: none; font-weight: 800; font-size: 17px; line-height: 1.25; }
.res .time small { display: block; font-size: 11px; font-weight: 500; color: var(--mute); }
.res .name { font-weight: 700; font-size: 16px; }
.res .memo { font-size: 13px; color: var(--warn); margin-top: 3px; }
.res .foot { display: flex; border-top: 1px solid var(--line); }
.res .foot > * {
  flex: 1; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 700; font-size: 14px; border: 0; background: none; cursor: pointer; border-left: 1px solid var(--line);
}
.res .foot > *:first-child { border-left: 0; }
.res .foot .go { color: var(--brand); }
.res.off { opacity: .55; }
.res.done .time { color: var(--mute); }
.staff-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }

/* ── 아래에서 올라오는 창 ── */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92dvh;
  border-radius: 20px 20px 0 0; background: var(--card); color: var(--ink); overflow: hidden;
}
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog.sheet::backdrop { background: rgba(15,25,22,.45); }
.sheet .head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.sheet .head h3 { font-size: 17px; }
.sheet .cont { padding: 0 16px 12px; overflow-y: auto; }
.sheet .acts { display: flex; gap: 10px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sheet .acts .btn { flex: 1; }
@media (min-width: 900px) { dialog.sheet { margin: auto; border-radius: 20px; } }

.suggest { border: 1px solid var(--line); border-radius: 12px; margin-top: 6px; overflow: hidden; }
.suggest:empty { display: none; }
.suggest button {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 11px 12px; border: 0; background: #fff;
  border-top: 1px solid var(--line); text-align: left; cursor: pointer;
}
.suggest button:first-child { border-top: 0; }

/* ── 매출 입력 ── */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.menu-btn {
  min-height: 62px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; text-align: left; line-height: 1.3;
}
.menu-btn b { font-size: 14px; }
.menu-btn span { font-size: 12px; color: var(--mute); }
.menu-btn:active { background: var(--brand-soft); border-color: var(--brand); }
.menu-btn.custom { border-style: dashed; color: var(--brand); align-items: center; }

.item { padding: 12px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 2px; }
.item .l1 { display: flex; align-items: center; gap: 8px; }
.item .l1 b { flex: 1; min-width: 0; }
.item .l2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.item .x { color: var(--mute); }
.item .in { min-height: 42px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg .btn { min-height: 54px; flex-direction: column; gap: 0; font-size: 15px; }
.seg .btn i { font-size: 18px; }
.seg .btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.paybar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); z-index: 25;
  background: var(--card); border-top: 1px solid var(--line); padding: 10px 14px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -6px 18px rgba(0,0,0,.06);
}
.paybar .amt { flex: 1; }
.paybar .amt small { display: block; font-size: 12px; color: var(--mute); }
.paybar .amt b { font-size: 22px; font-weight: 800; }
.paybar .btn { min-width: 132px; min-height: 52px; font-size: 16px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 90px); transform: translateX(-50%); z-index: 100;
  background: #1b2421; color: #fff; padding: 11px 18px; border-radius: 24px; font-weight: 600; font-size: 14px;
  max-width: 88vw; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.toast.bad { background: var(--danger); }

/* ── 로그인 ── */
.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(to bottom, #e3f1ee, rgba(227,241,238,.4), #ffffff); }
body:has(> .login) { padding-left: 0; }   /* 로그인·가입 화면에는 왼쪽 메뉴 자리가 없다 */
.login form { width: 100%; max-width: 400px; }
.login .pill { display: table; margin: 0 auto 10px; padding: 4px 12px; border-radius: 999px; background: #d3e9e4; color: var(--brand-dark); font-size: 14px; font-weight: 700; }
.login .wordmark { text-align: center; font-size: 40px; font-weight: 800; letter-spacing: -1px; color: var(--brand); margin-bottom: 18px; }
.login .wordmark i { font-size: 30px; margin-left: 2px; }
.login .btn.big { min-height: 58px; font-size: 18px; border-radius: 16px; border-width: 2px; border-color: var(--line); box-shadow: var(--shadow); }
.login .btn.primary.big { border-color: var(--brand); }
.login .logo {
  width: 60px; height: 60px; border-radius: 18px; background: var(--brand-soft); color: var(--brand); font-size: 30px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.login h1 { text-align: center; font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.login p { text-align: center; color: var(--mute); font-size: 16px; margin-bottom: 22px; }
