/* 들보 디자인 사무소 업무판 — 담백한 사내 도구 화면 */
@font-face { font-family: 'Pretendard Variable'; src: url('/fonts/PretendardVariable.woff2') format('woff2-variations'); font-weight: 45 920; font-display: swap; }

:root {
  --bg: #F4F3EF; --paper: #FFFFFF; --ink: #23262B; --muted: #6E727A; --line: #E2E0DA; --line-2: #EEECE7;
  --accent: #2F5D50; --accent-soft: #E3ECE8;
  --annual: #3E6FB0; --annual-bg: #E6EDF7;
  --half: #7A5BA8; --half-bg: #EEE8F5;
  --out: #A9702A; --out-bg: #F6ECDD;
  --pend: #B08A1E; --pend-bg: #FBF3D9;
  --ok: #2F7A4F; --ok-bg: #E2F1E8; --bad: #B1483C; --bad-bg: #F7E5E2;
  --r: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14.5px/1.55 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif; letter-spacing: -0.15px; word-break: keep-all; overflow-wrap: anywhere; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
h1, h2, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
body.is-staff .admin-only, body.is-admin .staff-only { display: none !important; }

/* ---------- 틀 ---------- */
.app { display: grid; grid-template-columns: 200px minmax(0, 1fr); grid-template-areas: 'top top' 'side main' 'foot main'; grid-template-rows: auto auto 1fr; max-width: 1240px; margin: 0 auto; min-height: calc(100vh - 40px); }
.top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.top__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top__brand strong { display: block; font-size: 15px; font-weight: 700; }
.top__sub { display: block; font-size: 12.5px; color: var(--muted); }
.top__mark { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; }
.top__who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.seg { display: inline-flex; padding: 3px; border-radius: 8px; background: #E7E5DF; }
.seg__btn { border: 0; background: none; padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg__btn.is-on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.who-pick select { height: 34px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236E727A' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center; appearance: none; -webkit-appearance: none; font-size: 13px; cursor: pointer; }
.who-admin { font-size: 13px; font-weight: 600; padding: 7px 10px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }

.side { grid-area: side; display: flex; flex-direction: column; gap: 2px; padding: 20px 12px 12px 16px; }
.side__btn { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: none; padding: 9px 12px; border-radius: 6px; text-align: left; font-size: 14.5px; font-weight: 500; color: #44484F; cursor: pointer; }
.side__btn:hover { background: #EAE8E2; }
.side__btn.is-on { background: var(--paper); color: var(--ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.badge { min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11.5px; font-weight: 700; text-align: center; }

.foot { grid-area: foot; padding: 16px 16px 24px 28px; }
.side__note { font-size: 12.5px; line-height: 1.6; color: var(--muted); padding-top: 14px; border-top: 1px solid var(--line); }
.side__note b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.foot .link-btn { margin-top: 12px; }

.main { grid-area: main; min-width: 0; padding: 24px 24px 56px; }
.view__head { margin-bottom: 18px; }
.view__head h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.view__desc { margin-top: 4px; color: var(--muted); font-size: 14px; }

/* ---------- 공용 ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 16px; min-width: 0; }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.panel__head h2 { font-size: 15px; font-weight: 700; }
.panel__head .muted { font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #C9C6BF; }
.btn--ink { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--ink:hover { background: #24493F; border-color: #24493F; }
.btn--sm { height: 30px; padding: 0 11px; font-size: 13px; }
.link-btn { border: 0; background: none; padding: 2px 0; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.link-btn:hover { color: var(--ink); }
input:not([type=checkbox]), select { min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #FCFCFA; font-size: 14px; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.empty { color: var(--muted); font-size: 13.5px; padding: 6px 0; }

.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.tag.t-annual { background: var(--annual-bg); color: var(--annual); }
.tag.t-half { background: var(--half-bg); color: var(--half); }
.tag.t-out { background: var(--out-bg); color: var(--out); }
.tag.t-urgent { background: var(--bad-bg); color: var(--bad); }
.status { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.s-pending { background: var(--pend-bg); color: #8A6A0E; }
.s-approved { background: var(--ok-bg); color: var(--ok); }
.s-rejected { background: var(--bad-bg); color: var(--bad); }
.s-cancelled { background: #EEEDEA; color: var(--muted); }

.check { display: inline-flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 14px; }
.check input { flex: none; width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }

/* 줄 목록 */
.table { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.row:first-child { border-top: 0; padding-top: 4px; }
.row--compact { padding: 9px 0; }
.row__main { min-width: 0; flex: 1; }
.row__title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.row__sub { margin-top: 3px; font-size: 13px; color: var(--muted); }
.row__note { margin-top: 6px; padding: 6px 10px; border-left: 2px solid var(--bad); background: #FBF6F5; font-size: 13px; }
.row__side { flex: none; display: flex; align-items: center; gap: 8px; }
.nums { gap: 12px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nums b { color: var(--ink); font-weight: 600; }
.nums .pend { color: #8A6A0E; }
.nums b.low { color: var(--bad); }

/* ---------- 오늘 ---------- */
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.home-grid .panel { margin: 0; }
.notice { padding: 10px 0; border-top: 1px solid var(--line-2); }
.notice:first-child { border-top: 0; padding-top: 2px; }
.notice.is-pin .notice__text { font-weight: 600; }
.notice__meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.notice__tools { display: inline-flex; gap: 12px; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form input { flex: 1; }
.todo { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 7px 0; }
.todo.is-done .check span { color: var(--muted); text-decoration: line-through; }
.todo__del { flex: none; border: 0; background: none; width: 26px; height: 26px; border-radius: 4px; color: #A3A6AC; font-size: 17px; line-height: 1; cursor: pointer; }
.todo__del:hover { background: #F1EFEA; color: var(--ink); }
.away { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.away:first-child { border-top: 0; padding-top: 2px; }
.away .muted { font-size: 13px; }
.jump li + li { border-top: 1px solid var(--line-2); }
.jump button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; border: 0; background: none; padding: 10px 0; text-align: left; font-size: 14px; color: #44484F; cursor: pointer; }
.jump button:hover b { text-decoration: underline; text-underline-offset: 3px; }
.jump b { color: var(--ink); white-space: nowrap; }

/* ---------- 휴가 ---------- */
.balance { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 16px; }
.balance__nums { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 12px; align-items: end; }
.balance__nums span { display: block; font-size: 12.5px; }
.balance__nums strong { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.balance__nums strong.big { font-size: 26px; color: var(--accent); letter-spacing: -0.5px; }
.meter { display: flex; height: 6px; margin-top: 14px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.meter__used { background: var(--accent); }
.meter__pend { background: #D9BE6A; }
.leave-form, .supply-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.leave-form label, .supply-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: #44484F; min-width: 0; }
.leave-form .wide { grid-column: 1 / -1; }
.supply-form .wide { grid-column: span 2; }
.leave-form .btn, .supply-form .btn { height: 38px; }
.leave-form .btn { grid-column: 3; }
.form-msg { font-size: 13px; min-height: 0; }
.form-msg:empty { display: none; }
.form-msg.is-err { color: var(--bad); }
.form-msg.is-ok { color: var(--ok); }

/* ---------- 일정판 ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav .btn--sm:first-child, .cal-nav .btn--sm:last-child { width: 32px; padding: 0; font-size: 17px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -6px 0 12px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 2px; }
.dot.t-annual { background: var(--annual); } .dot.t-half { background: var(--half); } .dot.t-out { background: var(--out); }
.dot.t-pending { background: #fff; border: 1.5px dashed var(--muted); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 16px; }
.cal__wd { padding: 8px 8px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); background: #FAFAF8; }
.cal__wd.is-sun { color: var(--bad); } .cal__wd.is-sat { color: var(--annual); }
.cal__cell { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-height: 104px; min-width: 0; padding: 6px; border: 0; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); background: var(--paper); text-align: left; cursor: pointer; }
.cal__cell:nth-child(7n) { border-right: 0; }
.cal__cell.is-blank { background: #FAFAF8; cursor: default; }
.cal__cell.is-weekend { background: #FBFAF7; }
.cal__cell:hover:not(.is-blank) { background: #F6F8F7; }
.cal__cell.is-picked { box-shadow: inset 0 0 0 2px var(--accent); }
.cal__num { font-size: 13px; font-weight: 600; color: #44484F; font-variant-numeric: tabular-nums; }
.cal__cell.is-today .cal__num { display: inline-grid; place-items: center; align-self: flex-start; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px; background: var(--ink); color: #fff; }
.cal__chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chip { display: flex; align-items: center; gap: 4px; min-width: 0; padding: 1px 6px; border-radius: 4px; font-size: 12px; line-height: 1.6; white-space: nowrap; }
.chip__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.chip__type { opacity: .8; flex: none; }
.chip.t-annual { background: var(--annual-bg); color: var(--annual); }
.chip.t-half { background: var(--half-bg); color: var(--half); }
.chip.t-out { background: var(--out-bg); color: var(--out); }
.chip.is-pending { background: #fff; box-shadow: inset 0 0 0 1px currentColor; border: 0; opacity: .85; }
.cal__more { font-size: 11.5px; color: var(--muted); padding-left: 4px; }
.cal__dots { display: none; }
.cal__dots i { width: 6px; height: 6px; border-radius: 50%; }
.cal__dots i.t-annual { background: var(--annual); } .cal__dots i.t-half { background: var(--half); } .cal__dots i.t-out { background: var(--out); }
.cal__dots i.is-pending { background: #fff; box-shadow: inset 0 0 0 1.5px var(--pend); }

/* ---------- 비품 ---------- */
.filter { display: inline-flex; gap: 4px; margin-bottom: 12px; padding: 3px; border-radius: 8px; background: #E7E5DF; }
.filter button { border: 0; background: none; padding: 5px 12px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.filter button.is-on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.steps { display: flex; gap: 0; margin-top: 8px; font-size: 12px; color: #A3A6AC; }
.steps li { display: flex; align-items: center; white-space: nowrap; }
.steps li + li::before { content: ''; display: inline-block; width: 18px; height: 1px; margin: 0 6px; background: var(--line); }
.steps li.is-on { color: var(--accent); font-weight: 600; }
.steps li.is-on + li.is-on::before { background: var(--accent); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 13.5px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 900px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .cal__cell { min-height: 88px; }
  .chip__type { display: none; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'top' 'side' 'main' 'foot'; grid-template-rows: none; min-height: 0; }
  .top { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px 12px; }
  .top__who { justify-content: space-between; flex-wrap: nowrap; gap: 8px; }
  .seg__btn { padding: 6px 10px; font-size: 12.5px; }
  .who-pick { min-width: 0; flex: 1; display: flex; justify-content: flex-end; }
  .who-pick select { width: 100%; max-width: 170px; text-overflow: ellipsis; }
  .side { position: sticky; top: 0; z-index: 20; flex-direction: row; gap: 0; padding: 0 8px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .side__btn { flex: 1; justify-content: center; gap: 4px; padding: 12px 2px 11px; border-radius: 0; font-size: 13.5px; white-space: nowrap; }
  .side__btn:hover { background: none; }
  .side__btn.is-on { background: none; box-shadow: inset 0 -2px 0 var(--accent); }
  .badge { min-width: 17px; padding: 0 5px; font-size: 10.5px; }
  .main { padding: 18px 16px 24px; }
  .foot { padding: 0 16px 40px; }
  .view__head h1 { font-size: 20px; }
  .panel, .balance { padding: 14px; }
  .row { flex-direction: column; align-items: stretch; gap: 8px; }
  .row__side { justify-content: flex-start; flex-wrap: wrap; }
  .row--compact { flex-direction: row; align-items: center; }
  #staffBalances .row--compact { flex-direction: column; align-items: stretch; gap: 2px; }
  .balance__nums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .balance__nums > div:first-child { grid-column: 1 / -1; }
  .leave-form, .supply-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leave-form .btn { grid-column: 1 / -1; }
  .supply-form .wide, .supply-form .btn { grid-column: 1 / -1; }
  .cal-head h1 { font-size: 18px; }
  .cal__wd { padding: 6px 0; text-align: center; }
  .cal__cell { min-height: 58px; padding: 4px 2px; align-items: center; }
  .cal__chips { display: none; }
  .cal__dots { display: flex; gap: 3px; margin-top: auto; padding-bottom: 4px; }
  .cal__cell.is-today .cal__num { align-self: center; }
}
