/* css/app.css - 워크포트: 그래파이트 왼쪽 메뉴 + 밝은 작업 판, 시그널 주황은 "지금 할 일"에만, 모서리 4px
   글꼴: Gothic A1 (글) + Space Grotesk (숫자) */
:root {
    --ink: #16181D;
    --ink-2: #4A4F57;
    --muted: #6B717B;          /* 흰 바탕 위 4.5:1 이상 */
    --line: #DADDE2;
    --line-2: #EDEEF1;
    --bg: #F2F3F5;
    --panel: #FFFFFF;
    --accent: #FF5B1F;
    --accent-ink: #C2410C;     /* 흰 바탕 글자용 진한 주황 */
    --ok: #1F7A45;
    --bad: #C0362C;
    --side: #16181D;
    --side-2: #262930;
    --r: 4px;
    --font: 'Gothic A1', 'Malgun Gothic', sans-serif;
    --num: 'Space Grotesk', 'Gothic A1', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.accent { color: var(--accent-ink) !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid transparent; font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #E84A10; }
.btn-accent:disabled { background: #C9CDD3; cursor: default; }
.btn-ghost { background: var(--panel); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-danger { background: var(--panel); border-color: var(--bad); color: var(--bad); }
.link { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13px; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r); cursor: pointer; font-size: 20px; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* 로그인 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--side); }
.login-card { width: min(560px, 100%); background: var(--panel); border-radius: 8px; padding: 36px; }
.login-card h1 { margin: 22px 0 6px; font-size: 28px; font-weight: 900; letter-spacing: -0.02em; }
.login-picks { display: grid; gap: 10px; margin: 22px 0 18px; }
.login-pick { display: flex; gap: 14px; align-items: center; text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); cursor: pointer; }
.login-pick:hover { border-color: var(--accent); }
.login-pick b { display: block; font-size: 16px; }
.login-pick small { display: block; font-size: 13px; }
.login-note { font-size: 13px; color: var(--muted); margin: 0; }
.login-foot { margin-top: 18px; display: flex; justify-content: flex-end; }
.brand-row { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-row b { font-size: 18px; font-weight: 900; }
.brand-mark { width: 26px; height: 26px; border-radius: var(--r); background: var(--accent); flex-shrink: 0; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.lang button { border: 0; background: var(--panel); padding: 6px 10px; font-family: var(--num); font-weight: 700; font-size: 12px; cursor: pointer; color: var(--muted); }
.lang button.on { background: var(--ink); color: #fff; }

/* 틀 */
.app { display: flex; min-height: 100vh; }
.side { width: 232px; flex-shrink: 0; background: var(--side); color: #C9CDD3; padding: 22px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand-row { color: #fff; padding: 0 10px; }
.side-company { font-size: 12px; color: #8A8F98; padding: 4px 10px 20px 46px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); text-decoration: none; font-size: 14px; color: #C9CDD3; }
.side-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; flex-shrink: 0; }
.side-link:hover { background: var(--side-2); color: #fff; }
.side-link.on { background: var(--side-2); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.side-link em { margin-left: auto; font-style: normal; background: var(--accent); color: #fff; border-radius: 3px; padding: 0 6px; font-size: 12px; font-family: var(--num); }
.side-me { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 14px 10px 0; border-top: 1px solid #2E3138; }
.side-me b { display: block; color: #fff; font-size: 14px; }
.side-me small { display: block; font-size: 12px; color: #8A8F98; }
.side-backdrop { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.top-date { font-size: 14px; color: var(--ink-2); }
.top-right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.switch-user select { height: 40px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 0 10px; font-size: 14px; max-width: 200px; }
.only-mobile { display: none; }
.view { padding: 26px 28px 40px; display: flex; flex-direction: column; gap: 18px; flex: 1; }
.foot { padding: 16px 28px 24px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.avatar { display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: #E4E6EA; color: var(--ink); font-weight: 900; }
.side .avatar { background: #3A3E47; color: #fff; }

/* 머리 · 판 */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 2px 0 2px; font-size: 26px; font-weight: 900; letter-spacing: -0.02em; }
.page-head p { margin: 0; }
.back { font-size: 13px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.panel h2 { margin: 0; font-size: 16px; font-weight: 900; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.panel-head > a:not(.btn) { font-size: 13px; color: var(--muted); }
h2.sub { font-size: 14px; margin: 18px 0 8px; color: var(--ink-2); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.grid-wide { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.grid-cal { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.empty { color: var(--muted); font-size: 14px; margin: 8px 0; }

/* 숫자 칸 */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; text-decoration: none; display: flex; flex-direction: column; }
.kpi:hover { border-color: var(--ink); }
.kpi small { font-size: 13px; color: var(--muted); }
.kpi b { font-size: 38px; font-weight: 700; line-height: 1.15; }
.kpi b span, .stats b span { font-size: 15px; color: var(--muted); margin-left: 2px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.stats small { display: block; font-size: 12px; color: var(--muted); }
.stats b { font-size: 26px; }

/* 출퇴근 */
.clock { display: flex; align-items: center; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 12px 18px; }
.clock-big { border: 0; padding: 0; justify-content: space-between; }
.clock-times { display: flex; gap: 16px; font-size: 14px; }
.clock-times b { font-size: 20px; margin-left: 4px; }
.clock-big .clock-times b { font-size: 30px; }

/* 목록 · 표 */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.list li:last-child { border-bottom: 0; }
.list a { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.list-big li { padding: 14px 0; flex-wrap: wrap; }
.list-big a { font-size: 15px; font-weight: 700; }
.pin { color: var(--accent-ink); font-size: 12px; font-weight: 900; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; flex-shrink: 0; }
.row-end { display: inline-flex; gap: 10px; align-items: center; justify-content: flex-end; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 10px 11px 0; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .list .num, .table td:has(.badge) { white-space: nowrap; }
.table td a { text-decoration: none; font-weight: 700; }
.table td a:hover { text-decoration: underline; text-underline-offset: 3px; }
.table select, .num-input { height: 34px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 0 8px; }
.num-input { width: 72px; font-family: var(--num); }

/* 표시 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.badge-pending { background: #FFF1EA; color: var(--accent-ink); }
.badge-approved { background: #E7F4EC; color: var(--ok); }
.badge-rejected { background: #FBEAE8; color: var(--bad); }
.badge-withdrawn { background: var(--line-2); color: var(--muted); }
.badge-type-leave { background: #EEF0FB; color: #3A46A8; }
.badge-type-expense { background: var(--panel); border-color: var(--line); color: var(--ink-2); }
.badge-type-general { background: var(--ink); color: #fff; }
.badge-kind-meeting { background: var(--line-2); color: var(--ink-2); }
.badge-kind-out { background: #EEF0FB; color: #3A46A8; }
.badge-kind-company { background: #FFF1EA; color: var(--accent-ink); }
.badge-role { background: var(--ink); color: #fff; margin-left: auto; }
.meter, .leave-bar { height: 10px; background: var(--line-2); border-radius: 2px; overflow: hidden; margin: 6px 0 10px; }
.meter span { display: block; height: 100%; background: var(--ink); }
.leave-bar span { display: block; height: 100%; background: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: var(--r); padding: 6px 12px; font-size: 13px; cursor: pointer; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
span.chip { cursor: default; }

/* 탭 */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 0; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs em { font-style: normal; background: var(--accent); color: #fff; border-radius: 3px; padding: 0 6px; font-size: 12px; font-family: var(--num); }

/* 입력 */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.form input:not([type="checkbox"]):not([type="radio"]), .form select, .form textarea { height: 42px; border: 1px solid var(--line); border-radius: var(--r); padding: 0 12px; background: var(--panel); font-weight: 400; font-size: 15px; color: var(--ink); }
.form textarea { height: auto; padding: 10px 12px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255, 91, 31, 0.18); }
.form .check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 160px; }
.row > .check { flex: 0 0 auto; padding-bottom: 10px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.seg { border: 0; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.seg legend { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; padding: 0; }
.seg label { flex-direction: row; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 14px; cursor: pointer; font-weight: 700; color: var(--ink); }
.seg label.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.seg input { accent-color: var(--accent); }
.search input { height: 40px; width: 260px; max-width: 100%; border: 1px solid var(--line); border-radius: var(--r); padding: 0 12px; background: var(--panel); }
.file-btn { cursor: pointer; }

/* 결재선 */
.line { list-style: none; margin: 8px 0 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.line li { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; }
.line li small { display: block; font-size: 12px; color: var(--muted); }
.line-v { flex-direction: column; }
.line-v li { border-left-width: 3px; }
.line li.done, .line li.approve { border-left-color: var(--ok); }
.line li.now { border-color: var(--accent); background: #FFF6F2; }
.line li.reject { border-left-color: var(--bad); }
.line li.wait { opacity: 0.7; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-weight: 700; }
.facts .big { font-size: 24px; }
.body-text { white-space: pre-line; margin: 0; font-size: 15px; line-height: 1.7; }
.note { margin: 12px 0 0; padding: 10px 14px; background: var(--bg); border-radius: var(--r); font-size: 14px; }
.decide { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); }

/* 달력 */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-head h2 { min-width: 140px; text-align: center; }
.cal-head .btn { margin-left: auto; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-wd { font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); }
.cal-wd.sun { color: var(--bad); }
.cal-day { min-height: 92px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); padding: 6px; text-align: left; display: flex; flex-direction: column; gap: 3px; cursor: pointer; overflow: hidden; }
.cal-day:hover { background: #FAFAFB; }
.cal-day.we > .num { color: var(--muted); }
.cal-day.today > .num { background: var(--accent); color: #fff; border-radius: 3px; padding: 0 5px; align-self: flex-start; }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-day.pad { background: var(--bg); cursor: default; }
.ev { font-style: normal; font-size: 11px; padding: 1px 5px; border-radius: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--line-2); }
.ev-out { background: #EEF0FB; color: #3A46A8; }
.ev-company { background: #FFF1EA; color: var(--accent-ink); }
.ev-more { font-style: normal; font-size: 11px; color: var(--muted); }

/* 조직도 */
.org { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.people li:last-child { border-bottom: 0; }
.people small { display: inline; font-size: 13px; color: var(--ink-2); }
.people small.muted { display: block; color: var(--muted); }

/* 알림 */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r); font-size: 14px; z-index: 50; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); max-width: calc(100% - 32px); }

/* 태블릿 · 휴대폰 */
@media (max-width: 1100px) {
    .grid-2, .grid-wide, .grid-cal { grid-template-columns: minmax(0, 1fr); }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .only-mobile { display: inline-grid; }
    .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform 0.2s; }
    .side-open .side { transform: none; }
    .side-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 39; }
    .top { padding: 10px 16px; flex-wrap: nowrap; gap: 8px; }
    .top-date { display: none; }
    .top-right { gap: 6px; flex-wrap: nowrap; }
    .switch-user select { max-width: 112px; padding: 0 6px; }
    .top .btn-ghost { padding: 0 10px; }
    .table { min-width: 540px; }   /* 좁은 화면에서는 표를 옆으로 밀어 본다 (글자가 한 글자씩 꺾이지 않게) */
    .view { padding: 18px 16px 32px; }
    .foot { padding: 14px 16px 20px; }
    .page-head h1 { font-size: 22px; }
    .clock { width: 100%; justify-content: space-between; }
    .cal-day { min-height: 58px; padding: 4px; }
    .ev { display: none; }
    .cal-day:has(.ev)::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
    .login-card { padding: 26px 20px; }
}
