:root{--bg:#f3f5f9;--card:#fff;--ink:#1c2430;--mute:#6b7685;--line:#d5dae3;--pri:#1f6feb;--red:#d92d20;--blue:#1f5fd1;--half:#ffe3b3;--off:#ffd5d5;--mine:#eef5ff}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:-apple-system,"Malgun Gothic","Noto Sans KR",sans-serif;font-size:16px}
button{font:inherit;cursor:pointer}
input,select{font:inherit}
.hidden{display:none!important}
#app{max-width:980px;margin:0 auto;padding:0 0 40px}
.top{display:flex;justify-content:space-between;align-items:center;gap:6px;padding:10px 12px;min-height:54px;background:var(--bg);position:sticky;top:0;z-index:20}
.top .title{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-weight:700;text-align:center;white-space:nowrap;pointer-events:none}
.top .tl{justify-self:start}
.top .tr{justify-self:end;display:flex;align-items:center;gap:6px}
.top .btn{white-space:nowrap}
@media(max-width:420px){.top{gap:4px;padding:10px 8px}.top .tr{gap:4px}.top .btn.sm{padding:5px 5px;font-size:12px}}
.top .who{font-size:13px;color:var(--mute)}
.btn{border:1px solid var(--line);background:#fff;border-radius:8px;padding:8px 12px}
.btn.pri{background:var(--pri);border-color:var(--pri);color:#fff}
.btn.danger{color:var(--red);border-color:#f1b5b0}
.btn.sm{padding:5px 9px;font-size:14px}
.page{padding:12px}
/* 로그인 */
.login{max-width:360px;margin:12vh auto 0;padding:24px 20px;background:var(--card);border-radius:14px;box-shadow:0 2px 14px #0001}
.login h1{margin:0 0 18px;text-align:center;font-size:22px}
.field{display:block;margin-bottom:12px}
.field span{display:block;font-size:13px;color:var(--mute);margin-bottom:4px}
.field input,.field select{width:100%;padding:12px;border:1px solid var(--line);border-radius:8px;background:#fff}
.err{color:var(--red);font-size:14px;white-space:pre-line;margin:6px 0}
/* 메인 */
.home{display:flex;flex-direction:column;gap:12px;padding:16px}
.homerow{display:flex;gap:12px;align-items:stretch}
.big{flex:1;min-height:18vh;border:0;border-radius:18px;font-size:28px;font-weight:700;color:#fff;box-shadow:0 3px 12px #0002}
.big small{display:block;font-size:14px;font-weight:400;opacity:.9;margin-top:6px}
.big.c{flex:0 0 auto;min-height:56px;font-size:18px;background:#55607a}
/* 월 이동 */
.mnav{display:flex;align-items:center;justify-content:center;gap:14px;margin:6px 0 12px}
.mnav h2{margin:0;font-size:22px;min-width:150px;text-align:center}
.mnav button{width:42px;height:42px;font-size:18px;border-radius:50%}
/* 배송일지 */
.tbl-wrap{overflow:auto;background:var(--card);border:1px solid var(--line);border-radius:10px;max-height:calc(100vh - 160px)}
@supports (height:100dvh){.tbl-wrap{max-height:calc(100dvh - var(--hh,54px) - 82px - env(safe-area-inset-bottom,0px))}}
table.dl{border-collapse:separate;border-spacing:0;width:100%}
.dl th,.dl td{border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:0;text-align:center}
.dl thead th{position:sticky;top:0;background:#e9eef7;padding:10px 6px;z-index:2;min-width:84px}
.dl th.day{position:sticky;left:0;background:#f4f6fa;z-index:1;min-width:64px;padding:0 6px;font-weight:600}
.dl thead th.day{z-index:3;background:#e9eef7}
.dl .sun{color:var(--red)}.dl .sat{color:var(--blue)}
.dl tr.today th.day{background:#fff3c4}
.dl input{width:100%;border:0;padding:11px 4px;text-align:center;font-size:17px;background:transparent;-moz-appearance:textfield}
.dl input::-webkit-outer-spin-button,.dl input::-webkit-inner-spin-button{-webkit-appearance:none}
.dl input:focus{outline:2px solid var(--pri);outline-offset:-2px;background:#f0f6ff}
.dl input:disabled{color:var(--ink);opacity:1}
.dl input.saved{background:#dff7e8}
.dl td.ro{background:#fafafa}
.dl tfoot td,.dl tfoot th{position:sticky;bottom:0;background:#e9eef7;font-weight:700;padding:10px 6px}
.dl tfoot th{left:0;z-index:3}
/* 휴무표 */
.notice{background:#fff8e1;border:1px solid #f0dc9a;border-radius:8px;padding:8px 10px;font-size:13px;margin-bottom:10px}
.me-box{display:flex;justify-content:space-between;align-items:center;font-size:15px;margin-bottom:8px}
.me-box b{color:var(--pri)}
.hint{font-size:12px;color:var(--mute);margin:4px 0 10px}
.legend{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:12px;margin-bottom:8px}
.legend .lg{display:flex;gap:10px;flex-wrap:wrap}
.legend i{display:inline-block;width:12px;height:12px;border-radius:3px;vertical-align:-2px;margin-right:3px;border:1px solid #0002}
table.wk{border-collapse:collapse;width:100%;table-layout:fixed;background:var(--card);margin-bottom:12px;font-size:11px;border:2px solid #1c2430}
.wk th,.wk td{border:1px solid #9aa4b5;padding:0;text-align:center;vertical-align:middle}
.wk thead th{background:#eef1f6;padding:6px 0;font-size:13px;position:sticky;top:var(--hh,53px);z-index:5;box-shadow:0 1px 0 #1c2430}
.wk thead th.lab{width:42px}
.wk tr.dr td{background:#eef1f6;font-size:12px;font-weight:600;padding:3px 0;border-top:2.5px solid #1c2430}
.wk .sun{color:var(--red)}.wk .sat{color:var(--blue)}
.wk td.lab{background:#f4f6fa;font-weight:600;font-size:10.5px;line-height:1.15;padding:2px}
.wk td.cell{height:22px;position:relative;overflow:hidden;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:pan-y}
.wk td.out{background:#f1f1f1;color:#888}
.wk td.mine{background:var(--mine)}
.wk td.edit{cursor:pointer}
.wk td.cell::after{content:"";position:absolute;left:0;bottom:0;height:4px;width:0;background:var(--pri)}
.wk td.cell.pressing::after{width:100%;transition:width 1s linear}
.nm{display:block;line-height:1.25;padding:1px 0;font-size:11px;white-space:nowrap}
.nm.full{background:none}
.nm.half{background:var(--half)}
.nm.me{font-weight:800;outline:1.5px solid var(--pri);outline-offset:-1.5px}
.nm em{font-style:normal;color:#d92d20;font-weight:700;margin-right:1px}
.sum{width:100%;border-collapse:collapse;background:var(--card);font-size:14px}
.sum th,.sum td{border:1px solid var(--line);padding:6px 8px;text-align:center}
.sum .over{color:var(--red);font-weight:700}
/* 관리자 */
.tabs{display:flex;gap:6px;padding-bottom:12px;position:sticky;top:var(--hh,54px);z-index:11;background:var(--bg)}
.tabs button{flex:1;padding:10px;border:1px solid var(--line);background:#fff;border-radius:8px}
.tabs button.on{background:var(--pri);color:#fff;border-color:var(--pri)}
.card{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:12px;margin-bottom:10px}
.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.grow{flex:1}
.tag{display:inline-block;font-size:11px;border-radius:10px;padding:1px 7px;background:#e6ebf5;color:#34425a;margin-right:4px}
.tag.o{background:#ffe3b3}.tag.r{background:#ffd5d5}.tag.g{background:#ddd}
.ulist .u{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 0;border-bottom:1px solid var(--line)}
.ulist .u:last-child{border:0}
.ulist .u.off{opacity:.5}
/* 모달/토스트 */
.modal{position:fixed;inset:0;background:#0007;display:flex;align-items:center;justify-content:center;z-index:50;padding:14px}
.modal .box{background:#fff;border-radius:14px;padding:18px;width:100%;max-width:420px;max-height:90vh;overflow:auto}
.modal h3{margin:0 0 12px}
.modal .acts{display:flex;gap:8px;justify-content:flex-end;margin-top:12px}
.chk{display:flex;align-items:center;gap:8px;margin:8px 0}
.chk input{width:20px;height:20px}
.pick{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:8px 0;border-bottom:1px solid var(--line)}
.toast{position:fixed;left:50%;bottom:26px;transform:translateX(-50%);background:#222c;color:#fff;padding:12px 18px;border-radius:10px;z-index:60;max-width:90vw;white-space:pre-line;text-align:center;font-size:14px}
.toast.bad{background:#b42318}
@media(min-width:700px){.wk td.cell{height:30px}.nm{font-size:13px}.wk td.lab{font-size:13px}.wk thead th.lab{width:80px}}

.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:6px 12px;font-size:15px}
.chip b{color:var(--pri);margin-left:4px}
.chip b.over{color:var(--red)}

.pickbtn{display:flex;justify-content:space-between;align-items:center;width:100%;position:relative;overflow:hidden;padding:14px 12px;margin-bottom:8px;border:1px solid var(--line);border-radius:10px;background:#fff;font-size:17px;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:manipulation}
.pickbtn small{color:var(--mute);font-size:13px}
.pickbtn b{font-size:14px}
.pickbtn.full{background:#fff;border-color:var(--pri)}
.pickbtn.half{background:var(--half)}
.pickbtn::after{content:"";position:absolute;left:0;bottom:0;height:4px;width:0;background:var(--pri)}
.pickbtn.pressing::after{width:100%;transition:width .5s linear .5s} /* 0.5초 뒤부터 로딩바가 차오르고, 1초에 반차 */

.pickbtn:disabled{opacity:.55;cursor:default;color:var(--ink)}

/* 홈 버튼: 가로 66px 유지, 높이는 다른 상단 버튼과 동일 */
.top #hBack{width:66px;padding-left:0;padding-right:0}

.donebtn{background:var(--pri);border-color:var(--pri);color:#fff;font-weight:700;padding:6px 16px}
.donebtn.on{background:#c9ced8;border-color:#c9ced8;color:#fff}
.chip.done{background:var(--red);border-color:var(--red);color:#fff;font-weight:700}
.chip.done b{color:#fff}
.chip.click{cursor:pointer}

.muted{color:var(--mute)}
.noticebox{background:#fff8e1;border:1px solid #f0dc9a;border-radius:12px;padding:12px 14px}
.nb-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
.nb-body{white-space:pre-wrap;word-break:break-word;font-size:15px;line-height:1.5}
.infobody{white-space:pre-wrap;word-break:break-word;line-height:1.6;min-height:120px}
.ct{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}
.ct:last-child{border:0}
.ct small{color:var(--mute)}
a.tel,.nb-body a,.infobody a{color:var(--pri);font-weight:600;text-decoration:none}

.homegrid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.homegrid .big{font-size:28px;padding:8px;word-break:keep-all;line-height:1.3}
.homegrid .big:last-child:nth-child(odd){grid-column:1 / -1}

/* 홈 화면: 흰 배경 + 연한 라벤더빛 투명 유리판 버튼 */
html:has(body.home-bg){background:#fff}
body.home-bg{background:#fff;min-height:100vh}
body.home-bg .top{background:#fff}
.hhead{position:sticky;top:0;z-index:20;background:#fff;padding-bottom:12px}
.hhead .noticebox{margin:0 16px}
.home{padding-top:4px}
.home .big{
  color:#1c2430;
  border:1px solid rgba(255,255,255,.95);
  background:linear-gradient(150deg,rgba(236,241,255,.95) 0%,rgba(222,228,247,.9) 55%,rgba(230,224,248,.9) 100%);
  box-shadow:
    0 12px 28px rgba(112,126,172,.22),          /* 바닥에 깔리는 은은한 그림자 */
    inset 0 0 0 3px rgba(255,255,255,.55),       /* 유리 가장자리 두께 */
    inset 0 3px 8px rgba(255,255,255,.95),       /* 윗면 빛 반사 */
    inset 0 -10px 20px rgba(150,165,215,.20),    /* 아래쪽 깊이감 */
    inset 0 2px 0 rgba(255,196,228,.70),         /* 윗 테두리 핑크빛 */
    inset 2px 0 0 rgba(176,206,255,.65);         /* 왼쪽 테두리 하늘빛 */
}
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .home .big{
    background:linear-gradient(150deg,rgba(236,241,255,.62) 0%,rgba(222,228,247,.55) 55%,rgba(230,224,248,.58) 100%);
    -webkit-backdrop-filter:blur(14px) saturate(150%);backdrop-filter:blur(14px) saturate(150%)
  }
}
.home .big:active{filter:brightness(.97);transform:scale(.99)}

/* 장부 양식 (날짜 · 금액 · 비고) */
table.lg{border-collapse:collapse;width:100%;table-layout:fixed;background:var(--card)}
.lg th,.lg td{border:1px solid #1c2430;padding:0;text-align:center}
.lg thead th{position:sticky;top:0;background:#eef1f6;padding:10px 4px;font-size:16px;z-index:2}
.lg .c1{width:17%}.lg .c2{width:41%}.lg .c3{width:42%}
.lg.tc .c1{width:17%}.lg.tc .c0{width:25%}.lg.tc .c2{width:28%}.lg.tc .c3{width:30%}
.lg input{width:100%;border:0;background:transparent;padding:11px 6px;font-size:16px;text-align:center}
.lg input.m{text-align:left}
.lg input.a{text-align:right;padding-right:10px}
.lg input:focus{outline:2px solid var(--pri);outline-offset:-2px;background:#f0f6ff}
.lg tr.saved td{background:#dff7e8}
.lg tfoot th,.lg tfoot td{position:sticky;bottom:0;background:#eef1f6;font-weight:700;padding:10px 6px;z-index:2}
.lg tfoot td{text-align:right;padding-right:12px}

/* 절임배추 예약건수: 달력 칸 */
.wk td.jc{height:44px;padding:0}
.wk td.jc input{width:100%;height:100%;min-height:44px;border:0;background:transparent;text-align:center;font-size:15px;font-weight:600;padding:0;-moz-appearance:textfield}
.wk td.jc input::-webkit-outer-spin-button,.wk td.jc input::-webkit-inner-spin-button{-webkit-appearance:none}
.wk td.jc input:focus{outline:2px solid var(--pri);outline-offset:-2px;background:#f0f6ff}
.wk td.jc input.saved{background:#dff7e8}
.wk td.jc.out{background:#f1f1f1}
.wk tr.dr td.tday{background:#fff3c4}
.jtotal{margin-top:6px;padding:12px 14px;background:var(--card);border:1px solid var(--line);border-radius:10px;text-align:right;font-size:16px}
.jtotal b{color:var(--pri);font-size:20px;margin:0 2px}

.homegrid .big{display:flex;align-items:center;justify-content:center;gap:12px}
.homegrid .big .bi{height:128px;width:auto;flex:none;filter:drop-shadow(0 3px 6px rgba(0,0,0,.18))}

/* 절임배추 예약건수: 글씨는 버튼 정중앙, 상자 그림은 글씨 왼쪽 빈 공간 */
.homegrid .big.d5{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px}
.big.d5 .jl{display:flex;justify-content:flex-end;min-width:0}
.big.d5 .jl .bi{height:128px;width:auto;max-width:100%;object-fit:contain;object-position:right center}
.big.d5 .jt{text-align:center}
@media(max-width:480px){.big.d5 .jt{max-width:120px;white-space:normal}}

/* 직원 비상연락망 표 */
table.em{width:100%;border-collapse:collapse;table-layout:fixed;background:#fff;font-size:13px;font-weight:600}
.em th,.em td{border:1.5px solid #1c2430;padding:7px 3px;text-align:center;word-break:keep-all}
.em th.emh{background:#539deb;color:#fff;font-size:20px;font-weight:800;padding:12px 4px}
.em tr.emc th{background:#fff;font-size:13px;font-weight:800;padding:9px 2px}
.em th:nth-child(1),.em td.gd{width:15%}
.em th:nth-child(2){width:13%}
.em th:nth-child(3){width:15%}
.em th:nth-child(4){width:33%}
.em th:nth-child(5){width:24%}
.em td.gd{font-weight:800;background:#fff}
.em td a{color:inherit;text-decoration:none;white-space:nowrap}
.em td{white-space:nowrap}
.em td.gd{white-space:normal}
.em tr.sp td{padding:0;height:9px;background:#f4f5f8}
@media(min-width:700px){.em{font-size:16px}.em tr.emc th{font-size:16px}}

/* 장부: 첫 줄은 새로 적는 줄 */
.lg tr.new td{background:#eaf4ff}
.lg tr.new input::placeholder{color:#7f9bbd;font-weight:400}

/* 장부: 확인 칸 (칸 전체를 눌러도 됨) */
.lg td.cc{padding:0;cursor:pointer}
.lg .ckb{display:block;width:28px;height:28px;margin:8px auto;padding:0;border:2px solid #b8c0cf;border-radius:7px;background:#fff;color:#12a37f;font-size:19px;font-weight:800;line-height:24px;pointer-events:none}
.lg .ckb.on{border-color:#12a37f;background:#e6f8f1}
.lg tr.ck td{background:#f4fbf8}

/* 장부: 날짜 선택(예: 12일(월)) + 삭제 열 */
.lg .c1{width:27%}.lg .c2{width:37%}.lg .c3{width:36%}
.lg.adm .c1{width:26%}.lg.adm .c2{width:30%}.lg.adm .c3{width:24%}.lg.adm .c4{width:20%}
.lg select{width:100%;border:0;background:transparent;padding:12px 4px;font-size:15px;font-weight:600;text-align:center;text-align-last:center;-webkit-appearance:none;appearance:none;color:inherit;border-radius:0}
.lg select:focus{outline:2px solid var(--pri);outline-offset:-2px;background:#f0f6ff}
.lg td.dc{padding:0}
.lg .delb{display:block;width:30px;height:30px;margin:7px auto;padding:0;border:1px solid #f1b5b0;border-radius:8px;background:#fff;color:var(--red);font-size:15px;font-weight:800;cursor:pointer}
.lg .delb:active{background:#fde8e8}

/* 장부: 확인 체크 + 확인한 사람 이름 */
.lg .ccw{display:flex;align-items:center;justify-content:center;gap:5px;min-height:44px;padding:0 3px}
.lg .ccw .ckb{margin:0;flex:none}
.lg .cby{font-size:12px;font-weight:700;color:#000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:56px}

/* 절임배추 예약: 날짜 칸은 합계 표시 + 누르면 추가 */
.wk td.jc.tap{cursor:pointer}
.wk td.jc .jn{display:flex;align-items:center;justify-content:center;min-height:44px;font-size:17px;font-weight:800;color:var(--pri)}
.wk td.jc.tap:active{background:#eaf4ff}
.jl-row{display:flex;justify-content:space-between;align-items:center;padding:9px 0;border-bottom:1px solid var(--line);font-size:17px}
.jl-row small{color:var(--mute);font-size:13px;margin-left:6px}
.jl-total{text-align:right;padding:10px 0 0;font-size:16px}
.jl-total b{color:var(--pri);font-size:22px}

/* 절임배추: 추가 내역 달력 (칸마다 건수 + 담당자명을 추가한 순서대로 쌓음) */
.wk td.jlog{vertical-align:top;padding:3px 2px;height:auto;min-height:44px}
.wk td.jlog .je{line-height:1.15;padding:3px 0;text-align:center;border-bottom:1px dashed #d5dae3}
.wk td.jlog .je:last-child{border-bottom:0}
.wk td.jlog .je b{display:block;font-size:15px;color:var(--pri)}
.wk td.jlog .je small{display:block;font-size:10.5px;color:var(--mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(min-width:700px){.wk td.jlog .je small{font-size:12px}.wk td.jlog .je b{font-size:17px}}

/* 추가 내역 달력: 숫자 옆(같은 줄)에 담당자 이름 */
.wk td.jlog .je{display:block;white-space:normal;text-align:center;line-height:1.3;padding:4px 1px}
.wk td.jlog .je b{display:inline;font-size:14px;color:var(--pri)}
.wk td.jlog .je small{display:inline;margin-left:3px;font-size:10.5px;color:var(--mute);white-space:nowrap;overflow:visible;text-overflow:clip}
@media(min-width:700px){.wk td.jlog .je b{font-size:17px}.wk td.jlog .je small{font-size:13px;margin-left:5px}}

/* 추가 내역 달력: 왼쪽 라벨 칸을 줄여서 날짜 칸을 넓히고, 숫자 옆에 이름이 같은 줄에 들어가게 */
.wk.logcal thead th.lab{width:28px}
.wk.logcal td.lab{width:28px;font-size:9.5px;padding:2px 1px;line-height:1.2}
.wk td.jlog{padding:2px 1px}
.wk td.jlog .je{padding:4px 0}
.wk td.jlog .je small{font-size:10px;margin-left:2px;letter-spacing:-.2px}
@media(min-width:700px){.wk.logcal thead th.lab{width:80px}.wk.logcal td.lab{width:80px;font-size:13px}.wk td.jlog .je small{font-size:13px;margin-left:5px;letter-spacing:0}}

/* 두 자리 숫자 + 3글자 이름도 한 줄에 들어가도록 한 번 더 조정 (아주 긴 이름은 아래로 줄바꿈) */
@media(max-width:699px){
  .wk td.jlog{padding:2px 0}
  .wk td.jlog .je b{font-size:13px}
  .wk td.jlog .je small{font-size:9.5px;margin-left:2px;letter-spacing:-.3px}
}
.lg.tc input.m{text-align:center}

/* 연휴·특별 근무일 */
.wk td.dnum.wkday{background:#ffe2c2;color:#8a4a00} /* 근무일은 주황, 오늘(노랑)과 구분 */
.wk td.dnum small{display:block;font-size:10px;font-weight:700;line-height:1}
.wk td.dnum.adm{cursor:pointer}
.wkrow{display:flex;align-items:center;gap:10px;background:var(--card);border:1px solid var(--line);border-radius:10px;padding:8px 12px;margin-bottom:6px}
.wkrow > span{flex:1;display:flex;flex-wrap:wrap;gap:6px}
.wkrow i{font-style:normal;background:#eef1f6;border-radius:12px;padding:3px 10px;font-size:14px}
.wkrow i.me{background:#dbeafe;font-weight:700}

/* 동시휴무 금지 그룹: 같이 쉬어도 되는 요일 버튼 */
.okd{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin-top:8px}
.okd > span{font-size:13px;color:var(--mute);margin-right:4px}
.dayb{min-width:34px;padding:6px 0;border:1px solid var(--line);border-radius:8px;background:#fff;font-size:14px}
.dayb.on{background:var(--pri);border-color:var(--pri);color:#fff;font-weight:700}

/* 홈 공지: 제목 + 본문(3줄까지) */
.nb-click{cursor:pointer}
.nb-title{font-weight:700;margin-bottom:4px}
.nb-clamp{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
