/* PC 화면 (창 너비 1024px 이상). index.html에서 media="(min-width: 1024px)"로만 적용된다.
   폰 화면은 이 파일과 상관없이 styles.css 그대로. 더보기 → 설정에서 'PC 화면으로 보기'를 끄면 html.phone-ui → 여기 규칙이 모두 꺼진다.
   같은 #tabbar가 왼쪽 메뉴가 되고(app.js drawTabs), 입력 창(U.sheet)은 가운데 창이 된다. */
html:not(.phone-ui) { --nav-w: 232px; }
html:not(.phone-ui), html:not(.phone-ui) body { background: var(--bg); }

/* ---------- 바탕: 폰 모양 카드 대신 전체 화면 ---------- */
html:not(.phone-ui) .app { max-width: none; margin: 0; min-height: 100vh; border-radius: 0; overflow: visible; box-shadow: none; padding-left: var(--nav-w); }
html:not(.phone-ui) main { max-width: 760px; margin: 0 auto; padding: 28px 32px 56px; }
/* 넓게 쓰는 화면: 스케줄 표(기본 스케줄·이번 주·오늘) */
html:not(.phone-ui) main[data-page=staff][data-seg=template],
html:not(.phone-ui) main[data-page=staff][data-seg=week],
html:not(.phone-ui) main[data-page=staff][data-seg=today] { max-width: 1180px; }
/* 첫 화면(가입·로그인): 왼쪽 메뉴 없이 가운데 */
html.nonav:not(.phone-ui) .app { padding-left: 0; }
html.nonav:not(.phone-ui) main { max-width: 520px; padding-top: 0; padding-bottom: 0; }

/* ---------- 왼쪽 메뉴 ---------- */
html:not(.phone-ui) .tabbar { top: 0; bottom: 0; left: 0; transform: none; width: var(--nav-w); max-width: none; height: 100vh; padding: 16px 12px 12px; border-top: none; border-right: 1px solid var(--line); border-radius: 0; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 2px; overflow-y: auto; }
html:not(.phone-ui) .nav-head { display: flex; order: 0; align-items: center; gap: 10px; padding: 4px 8px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--ink); }
html:not(.phone-ui) .nav-head .store-logo { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
html:not(.phone-ui) .nav-head .store-logo img { width: 30px; height: 30px; }
html:not(.phone-ui) .nav-store { font-size: 15px; font-weight: 800; line-height: 1.3; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: keep-all; }
html:not(.phone-ui) .tabbar .tab,
html:not(.phone-ui) .tabbar .nav-x { order: 1; flex: none; display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--ink-2); white-space: nowrap; position: relative; }
html:not(.phone-ui) .tabbar .tab.on { color: var(--ink-2); }
html:not(.phone-ui) .tabbar .tab.cur,
html:not(.phone-ui) .tabbar .nav-x.cur { background: var(--brand-soft); color: var(--ink); font-weight: 800; }
html:not(.phone-ui) .tabbar .tab svg,
html:not(.phone-ui) .tabbar .nav-x svg { width: 20px; height: 20px; flex: none; }
html:not(.phone-ui) .tabbar .tab-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
html:not(.phone-ui) .tabbar .tab-badge { position: static; margin-left: auto; }
html:not(.phone-ui) .tabbar .tab-more { order: 3; }
html:not(.phone-ui) .nav-tools { display: flex; order: 2; flex-direction: column; gap: 2px; margin: 10px 0; padding-top: 10px; border-top: 1px solid var(--line); }
html:not(.phone-ui) .nav-group { font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 2px 12px 6px; }
html:not(.phone-ui) .nav-foot { display: flex; order: 4; margin-top: auto; padding: 12px 8px 0; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
html:not(.phone-ui) .nav-sync { flex-basis: 100%; font-size: 12px; color: var(--ink-3); line-height: 1.4; }
html:not(.phone-ui) .nav-sync:empty { display: none; }
html:not(.phone-ui) .nav-ver { font-size: 12px; color: var(--ink-3); margin-left: auto; }
/* 노트북처럼 세로가 짧은 화면: 메뉴 줄 간격을 줄여서 아래(언어·버전)까지 한 화면에 */
@media (max-height: 860px) {
  html:not(.phone-ui) .tabbar .tab, html:not(.phone-ui) .tabbar .nav-x { min-height: 36px; font-size: 14px; }
  html:not(.phone-ui) .nav-head { padding-bottom: 10px; margin-bottom: 4px; }
  html:not(.phone-ui) .nav-tools { margin: 6px 0; padding-top: 6px; }
}
/* 왼쪽 메뉴에 다 있으니 '‹ 더보기로' 뒤로 버튼은 필요 없다 (장부로 돌아가는 ‹ 는 그대로) */
html:not(.phone-ui) .back[data-go="#/more"] { display: none; }

/* ---------- 입력 창: 아래에서 올라오는 대신 가운데 창 ---------- */
html:not(.phone-ui) .sheet { top: 50%; bottom: auto; width: calc(100% - 48px); max-width: 560px; max-height: 86vh; border-radius: 20px; padding: 22px 24px 0; opacity: 0; transform: translate(-50%, -47%) scale(.98); transition: transform .18s ease, opacity .18s ease; box-shadow: 0 24px 60px rgba(0,0,0,.18); }
html:not(.phone-ui) .sheet-wrap.open .sheet { opacity: 1; transform: translate(-50%, -50%); }
html:not(.phone-ui) .sheet-grip { display: none; }
html:not(.phone-ui) .sheet-actions { position: sticky; bottom: 0; background: var(--card); padding: 14px 0 22px; margin-top: 14px; z-index: 2; }

/* ---------- 알림(토스트): 아래 탭이 없으니 아래쪽, 내용 가운데 ---------- */
html:not(.phone-ui) .toast { bottom: 28px; left: calc(50% + var(--nav-w) / 2); max-width: 560px; }
html.nonav:not(.phone-ui) .toast { left: 50%; }

/* ---------- 마우스 ---------- */
@media (hover: hover) {
  html:not(.phone-ui) .tabbar a:hover:not(.cur) { background: #F2F4F6; color: var(--ink); }
  html:not(.phone-ui) .row.tap:hover .title { color: var(--brand); }
  html:not(.phone-ui) .tcell:hover { box-shadow: inset 0 0 0 1.5px var(--brand); }
  html:not(.phone-ui) .tcell.mk:hover { box-shadow: inset 0 0 0 2px var(--warn); }
  html:not(.phone-ui) .btn:hover { filter: brightness(.97); }
  html:not(.phone-ui) .menu-item:hover .chip-ico { filter: brightness(.96); }
}
html:not(.phone-ui) :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- 스케줄 표: 이름 칸·요일 칸을 넓게 ---------- */
html:not(.phone-ui) main[data-page=staff] .tgrid { grid-template-columns: 112px repeat(7, minmax(0, 1fr)) 52px; gap: 5px; margin-bottom: 6px; }
@media (min-width: 1280px) { html:not(.phone-ui) main[data-page=staff] .tgrid { grid-template-columns: 150px repeat(7, minmax(84px, 1fr)) 64px; gap: 6px; } }
html:not(.phone-ui) main[data-page=staff] .tcell { height: 54px; font-size: 13px; border-radius: 10px; }
html:not(.phone-ui) main[data-page=staff] .tcell sup { font-size: 10px; }
html:not(.phone-ui) main[data-page=staff] .tcell i { font-size: 10px; line-height: 15px; top: -7px; }
html:not(.phone-ui) main[data-page=staff] .tname { font-size: 14px; }
html:not(.phone-ui) main[data-page=staff] .tgrid-head div { font-size: 14px; }
html:not(.phone-ui) main[data-page=staff] .tgrid-head small { font-size: 12px; }
html:not(.phone-ui) main[data-page=staff] .tgrid-foot div { font-size: 12px; }
html:not(.phone-ui) main[data-page=staff] .tgrid-role { font-size: 13px; margin-top: 14px; }

/* ---------- 급여 계산: 넓은 화면에서 입력은 왼쪽, 결과는 오른쪽 ---------- */
@media (min-width: 1280px) {
  html:not(.phone-ui) main[data-page=payroll] { max-width: 1180px; }
  html:not(.phone-ui) .pay-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  html:not(.phone-ui) .pay-top [data-jump] { display: none; }
}

/* ---------- 은행 파일·재무제표 검토: 저장 버튼이 아래에 붙어 있게, 거래처는 한 줄로 ---------- */
html:not(.phone-ui) .review-actions { position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: 2fr 1fr; gap: 8px; padding: 16px 0 18px; margin-bottom: 4px; background: linear-gradient(rgba(242,244,246,0), var(--bg) 28%); }
html:not(.phone-ui) .review-actions .btn { margin-top: 0 !important; }
html:not(.phone-ui) main[data-page=bank] .imp-row { display: grid; grid-template-columns: minmax(0, 1fr) 400px; column-gap: 16px; align-items: center; }
html:not(.phone-ui) main[data-page=bank] .imp-row > div[style*="grid"] { grid-template-columns: 220px minmax(0, 1fr) !important; }
html:not(.phone-ui) main[data-page=bank] .imp-row .val { text-align: right; }
html:not(.phone-ui) main[data-page=bank] .imp-row .imp-head { margin-bottom: 0; justify-content: flex-start; }
html:not(.phone-ui) main[data-page=bank] .imp-row > .sub { grid-column: 1 / -1; }

/* ---------- 그래프는 너무 크게 늘어나지 않게 ---------- */
html:not(.phone-ui) .chart { max-width: 520px; margin-left: auto; margin-right: auto; }

/* ---------- 2단계: 넓은 화면(1280px 이상)에서 홈·장부 두 칸 ---------- */
@media (min-width: 1280px) {
  html:not(.phone-ui) main[data-page=home], html:not(.phone-ui) main[data-page=ledger] { max-width: 1180px; }
  /* 홈: 왼쪽 챙길 일·오늘 매출, 오른쪽 바로가기·이번 달·오늘 근무·카톡방 */
  html:not(.phone-ui) .home-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0 16px; align-items: start; }
  html:not(.phone-ui) .home-b .actions { margin-top: 0; }
  /* 장부: 손익·원가율 옆에 종류별·예상 지출, 지출 내역은 아래 넓게 */
  html:not(.phone-ui) .led-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; align-items: start; }
  html:not(.phone-ui) .led-top:has(> .led-b:empty) { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
}html:not(.phone-ui) .pc-only:not([hidden]) { display: flex !important; }
/* ---------- 2단계: 리포트 화면 두 칸 (메뉴별 판매·배달앱 정산·리뷰), 1280px 이상 ---------- */
@media (min-width: 1280px) {
  html:not(.phone-ui) main[data-page=pos], html:not(.phone-ui) main[data-page=delivery], html:not(.phone-ui) main[data-page=reviews] { max-width: 1180px; }
  html:not(.phone-ui) .rep-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; align-items: start; }
  html:not(.phone-ui) .rv-cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 16px; align-items: start; }
  html:not(.phone-ui) .rv-a:empty { display: none; }
  html:not(.phone-ui) .rv-cols:has(> .rv-a:empty) { grid-template-columns: minmax(0, 1fr); }
}
/* ---------- 3단계: 입력 창 ✕ 닫기 ---------- */
html:not(.phone-ui) .sheet-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
html:not(.phone-ui) .sheet-x { display: grid; place-items: center; flex: none; width: 36px; height: 36px; margin: -6px -8px 0 0; border: none; border-radius: 10px; background: none; cursor: pointer; color: var(--ink-3); }
html:not(.phone-ui) .sheet-x::before { content: '✕'; font-size: 17px; font-weight: 700; }
html:not(.phone-ui) .sheet-x:hover { background: var(--field); color: var(--ink); }

/* ---------- 3단계: 영수증 보관함 = 목록 + 오른쪽 옆 창 (1280px 이상, U.sheet side) ---------- */
@media (min-width: 1280px) {
  html:not(.phone-ui) { --side-w: 460px; }
  html:not(.phone-ui) main[data-page=receipts] { max-width: none; margin: 0 var(--side-w) 0 0; }
  html:not(.phone-ui) main[data-page=receipts] .rv-detail-empty { display: flex; position: fixed; top: 0; right: 0; bottom: 0; width: var(--side-w); flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--card); border-left: 1px solid var(--line); color: var(--ink-3); font-size: 14px; text-align: center; }
  html:not(.phone-ui) .rv-detail-empty div { font-size: 40px; }
  html:not(.phone-ui) .rv-detail-empty b { color: var(--ink-2); font-size: 16px; }
  html:not(.phone-ui) .sheet-wrap.side { left: auto; width: var(--side-w); }
  html:not(.phone-ui) .sheet-wrap.side .sheet-bg { display: none; }
  html:not(.phone-ui) .sheet-wrap.side .sheet { top: 0; bottom: 0; left: 0; width: 100%; max-width: none; max-height: none; height: 100vh; border-radius: 0; transform: none; opacity: 0; box-shadow: -12px 0 32px rgba(0,0,0,.08); border-left: 1px solid var(--line); transition: opacity .15s ease; }
  html:not(.phone-ui) .sheet-wrap.side.open .sheet { transform: none; opacity: 1; }
  html:not(.phone-ui) .sheet-wrap.side .receipt-big { max-height: 46vh; }
  html:not(.phone-ui) .sheet-wrap.side .receipt-big img { max-height: 46vh; }
  html:not(.phone-ui) body:has(.sheet-wrap.side:not(.closing)) .row.sel { background: var(--brand-soft); border-radius: 12px; margin: 0 -10px; padding-left: 10px; padding-right: 10px; }
}
/* ---------- 3단계: 장부 지출 내역 표 보기 (1280px 이상) ---------- */
@media (min-width: 1280px) {
  html:not(.phone-ui) .exp-card { --exp-cols: 22px 40px minmax(0, 2.2fr) minmax(0, 1.3fr) 72px 96px 120px; }
  html:not(.phone-ui) .exp-card .xc-pick, html:not(.phone-ui) .exp-head input { display: block; width: 18px; height: 18px; margin: 0; accent-color: var(--brand); cursor: pointer; }
  html:not(.phone-ui) .exp-card select.xc-cat { height: 34px; border-radius: 8px; border: 1px solid transparent; background: transparent; padding: 0 6px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
  html:not(.phone-ui) .exp-card select.xc-cat:hover, html:not(.phone-ui) .exp-card select.xc-cat:focus { border-color: var(--line); background: var(--field); }
  html:not(.phone-ui) .exp-head { display: grid; grid-template-columns: var(--exp-cols); gap: 12px; padding: 12px 0 8px; margin-top: 8px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink-3); }
  html:not(.phone-ui) .exp-card .row[data-exp] { display: grid; grid-template-columns: var(--exp-cols); gap: 12px; align-items: center; }
  html:not(.phone-ui) .exp-card .row[data-exp] .sub { display: none; }
  html:not(.phone-ui) .exp-card .xc { display: block; font-size: 14px; color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html:not(.phone-ui) .exp-card .xc-memo { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
  html:not(.phone-ui) .exp-card .xc-num, html:not(.phone-ui) .exp-head .xc-num, html:not(.phone-ui) .exp-card .row[data-exp] .val { text-align: right; font-variant-numeric: tabular-nums; }
  html:not(.phone-ui) .exp-card .list-date { margin-top: 14px; }
}
/* ---------- 3단계: 구인 공고·차량 운행일지 두 칸 (1280px 이상) ---------- */
@media (min-width: 1280px) {
  html:not(.phone-ui) main[data-page=hiring], html:not(.phone-ui) main[data-page=mileage] { max-width: 1180px; }
  /* 구인 공고: 왼쪽 고르는 칸, 오른쪽 완성된 공고 (저장한 공고를 열어도 같은 자리) */
  html:not(.phone-ui) .hire-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; align-items: start; }
  html:not(.phone-ui) .hire-form { grid-column: 1; grid-row: 1; }
  html:not(.phone-ui) .hire-out { grid-column: 2; grid-row: 1; }
  html:not(.phone-ui) .hire-note { display: none; }
  html:not(.phone-ui) .mi-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; align-items: start; }
}
/* 세로가 넉넉하면 완성된 공고가 따라 내려오게 (고르면서 바로 보이게) */
@media (min-width: 1280px) and (min-height: 860px) {
  html:not(.phone-ui) .hire-out { position: sticky; top: 16px; }
}
/* ---------- 관리자 사용 현황: 넓은 화면 두 칸 ---------- */
@media (min-width: 1280px) {
  html:not(.phone-ui) main[data-page=admin] { max-width: 1180px; }
  html:not(.phone-ui) .admin-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; align-items: start; }
}
/* ---------- 매출 달력: PC는 칸을 크게, 금액을 다 ---------- */
html:not(.phone-ui) .cal-cell { min-height: 76px; padding: 8px 4px; }
html:not(.phone-ui) .cal-d { font-size: 13px; }
html:not(.phone-ui) .cal-v { font-size: 14px; }
html:not(.phone-ui) .cal-full { display: inline; }
html:not(.phone-ui) .cal-short { display: none; }
@media (hover: hover) { html:not(.phone-ui) .cal-cell:not(.blank):not(.future):hover { box-shadow: inset 0 0 0 1.5px var(--brand); } }