/* =====================================================================
   musign ERP — design system (Pretendard)
   Sufly design rules: NO box-shadow / border boxes / left-border. Surface
   contrast (white ↔ gray-50) for separation. Active = #111 / light gray tint
   (never blue). Min 12px. Inputs = bottom line only. Primary = black #111 (2026-10-13 남색에서 바꿈).
   ============================================================================ */
@font-face {
    font-family: 'Pretendard Variable';
    font-weight: 45 920;
    font-style: normal;
    font-display: swap;
    src: url('/fonts/PretendardVariable.woff2') format('woff2-variations');
}

:root {
    --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
            'Segoe UI', 'Malgun Gothic', system-ui, sans-serif;
    --bg: #f8f9fa;              /* page: gray-50 */
    --surface: #ffffff;
    --surface-2: #fcfcfc;
    --ink: #111111;
    --ink-2: #4b5563;          /* gray-600 body */
    --ink-3: #6b7280;          /* gray-500 meta */
    --ink-4: #9ca3af;          /* gray-400 */
    --line: rgba(17, 17, 17, .08);   /* internal dividers only (never a box outline) */
    --line-soft: rgba(17, 17, 17, .06);
    --tint: rgba(17, 17, 17, .04);   /* hover / selected background */
    --tint-2: rgba(17, 17, 17, .02);
    --primary: #111111;        /* 검정: 버튼 · 강조 면(2026-10-13 남색 #1e1e5a 에서 바꿈) */
    --accent: #316ff6;         /* brand accent — links / emphasis only (not active tint) */
    --sidebar: #111114;
    --radius: 12px;            /* blocks / cards (m-CHAT --admin-radius) */
    --radius-lg: 14px;         /* drawers / overlays */
    --radius-ctrl: 8px;        /* buttons / controls / popover trigger */
    --shadow-floating: 0 4px 16px rgba(17, 17, 17, .06);  /* overlays only (drawer/popover/toast) */
    --ok: #15803d; --ok-bg: #dcfce7;
    --warn: #b45309; --warn-bg: #fef3c7;
    --danger: #dc2626; --danger-bg: #fee2e2;
    --info: #1d4ed8; --info-bg: #dbeafe;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -.01em;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }

/* ---- Type scale (consistent hierarchy; hard floor 12px) ---------------------
   h1 24/800 page title · h2 18/700 section · h3 16/700 · h4 14/700
   .h5 12/700 caps labels/table-head · .h6 12/600 meta · body 14 · min 12px. */
.h1 { font-size: 1.5rem;  font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: var(--ink); }
.h2 { font-size: 1.125rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; color: var(--ink); }
.h3 { font-size: 1rem;   font-weight: 700; line-height: 1.35; color: var(--ink); }
.h4 { font-size: .875rem; font-weight: 700; line-height: 1.4; color: var(--ink); }
.h5 { font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.h6 { font-size: .75rem; font-weight: 600; color: var(--ink-3); }
.desc, .meta-txt { font-size: .875rem; color: var(--ink-3); }
small, .txt-min { font-size: .75rem; }   /* 12px floor — never below */

/* ---- App shell ---- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px; flex-shrink: 0; background: var(--sidebar); color: #c6c6cb;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { padding: 1.1rem 1.2rem; display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 800; font-size: 1rem; letter-spacing: -.02em; }
.sidebar .brand .logo { width: 26px; height: 26px; border-radius: 7px; background: #fff; display: grid; place-items: center; color: #111; font-size: .8rem; }.nav-group { padding: .5rem 0 .2rem; }
.nav-group .label { padding: .5rem 1.2rem .25rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em; color: #7c7c84; }
.nav-item { display: flex; align-items: center; gap: .7rem; padding: .58rem 1.2rem; color: #c6c6cb; font-size: .875rem; font-weight: 500; cursor: pointer; }
.nav-item:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 700; }   /* light tint, no blue, no left-bar */
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 2; opacity: .92; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; background: var(--surface); display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; position: sticky; top: 0; z-index: 20; }
.topbar .crumb { font-size: .9rem; color: var(--ink-3); font-weight: 600; }
.topbar .crumb b { color: var(--ink); }
.topbar .user { display: flex; align-items: center; gap: .8rem; font-size: .84rem; color: var(--ink-2); }
.topbar .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--tint); color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }

/* 퇴근 타이머 (우측 상단) */
.offclock { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--ink-2);
    background: var(--tint-2); border-radius: 999px; padding: .22rem .6rem; font-variant-numeric: tabular-nums; }
.offclock.over { color: var(--danger); }

/* 알림 벨 + 배지 + 팝오버 */
.noti-bell { position: relative; background: none; border: 0; cursor: pointer; color: var(--ink-2); display: inline-flex; padding: .3rem; border-radius: 8px; }
.noti-bell:hover { background: var(--tint-2); }
.noti-bell svg { width: 20px; height: 20px; }
.noti-badge { position: absolute; top: -1px; right: -1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
    background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700; display: none; align-items: center; justify-content: center; line-height: 1; }
.noti-badge.show { display: inline-flex; }
/* 헤더 결재 대기 표시 · 사이드바 결재함 숫자 */
.hd-approval { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem; border-radius: 999px;
    background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.hd-approval:hover { background: color-mix(in srgb, var(--danger) 16%, transparent); }
.hd-approval b { font-variant-numeric: tabular-nums; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff;
    font-size: .75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.noti-pop { position: absolute; top: 46px; right: 1.2rem; width: 360px; max-width: 92vw; z-index: 80; background: var(--surface);
    border-radius: var(--radius); box-shadow: var(--shadow-floating); padding: .4rem; display: none; }
.noti-pop.open { display: block; }
.noti-pop .np-head { display: flex; align-items: center; justify-content: space-between; padding: .5rem .6rem; }
.noti-pop .np-head b { font-size: .9rem; color: var(--ink); }
.noti-pop .np-list { max-height: 380px; overflow-y: auto; }
.noti-pop .np-foot { text-align: center; border-top: 1px solid var(--line); padding: .5rem; }

/* 알림 아이템 (팝오버 + 페이지 공용) */
.noti-item { padding: .65rem .7rem; border-radius: 8px; cursor: pointer; border-bottom: 1px solid rgba(17,17,17,.05); }
.noti-item:last-child { border-bottom: 0; }
.noti-item:hover { background: var(--tint-2); }
.noti-item.unread { background: rgba(17,17,17,.035); }
.noti-item.unread b::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); margin-right: .4rem; vertical-align: middle; }

/* 언더바 탭 (디자인 시스템: active=#111 언더바) */
.tabs .tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: .55rem .8rem; font-size: .875rem; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.tabs .tab:hover { color: var(--ink-2); }
.tabs .tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.content { padding: 1.5rem 1.8rem; max-width: 1240px; width: 100%; }

/* ---- Page header ---- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 1.3rem; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.5rem; font-weight: 700; }
.page-head .desc { color: var(--ink-3); font-size: .875rem; margin-top: .25rem; font-weight: 400; }

/* ---- Buttons (black primary, no shadow) ---- */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1rem; border-radius: var(--radius-ctrl); border: 0; font-family: inherit; font-size: .875rem; font-weight: 700; cursor: pointer; background: var(--primary); color: #fff; transition: opacity .12s, background .12s; }
.btn:hover { opacity: .9; }
.btn svg { width: 16px; height: 16px; }
.btn.ghost { background: var(--tint); color: var(--ink); }
.btn.ghost:hover { background: rgba(17,17,17,.07); opacity: 1; }
.btn.danger { background: var(--danger-bg); color: var(--danger); }
.btn.danger:hover { opacity: 1; background: #fdd5d5; }
.btn.accent { background: var(--accent); }
.btn.sm { padding: .36rem .7rem; font-size: .8rem; }

/* ---- Cards / panels (NO border, NO shadow — white on gray page) ---- */
.card { background: var(--surface); border-radius: var(--radius); }
.card .card-body { padding: 1.2rem 1.3rem; }
.toolbar { display: flex; gap: .5rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

/* inputs: bottom line only, square, focus underline color */
.input, select.input, textarea.input {
    font-family: inherit; font-size: .9rem; padding: .5rem .1rem; color: var(--ink);
    background: transparent; width: 100%;
    border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
}
.input:focus { outline: none; border-bottom-color: var(--primary); }
.input::placeholder { color: var(--ink-4); }
/* 바꿀 수 없는 칸(권한이 없어 잠근 칸 등)은 흐리게 보여 누를 수 없다는 것을 알린다 */
.input:disabled { color: var(--ink-3); cursor: not-allowed; }
.pop-select > select:disabled ~ .pop-trigger, .dp-trigger:disabled { opacity: .6; cursor: not-allowed; }
.pop-select > select:disabled ~ .pop-trigger:hover, .dp-trigger:disabled:hover { background: var(--tint-2); }
select.input { padding-left: 0; }
.search { max-width: 260px; }

/* ---- Table (minimal SaaS: no wrapper box/shadow — hairline row+col dividers,
   generous vertical padding, tonal header, 12px uppercase head) ---- */
.table-wrap { background: var(--surface); border-radius: var(--radius); overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.grid { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.grid th, table.grid td { text-align: left; padding: .9rem 1.05rem; white-space: nowrap; vertical-align: middle; }
/* hairline column dividers (very faint) — dropped on the last cell */
table.grid th:not(:last-child), table.grid td:not(:last-child) { border-right: 1px solid var(--line-soft); }
table.grid thead th { color: var(--ink-3); font-weight: 700; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase;
    background: var(--surface-2); border-bottom: 1px solid var(--line); }
table.grid tbody td { border-bottom: 1px solid var(--line-soft); color: var(--ink); }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover { background: var(--tint-2); }
table.grid tbody tr.clickable:hover { background: var(--tint); cursor: pointer; }
table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; padding: .13rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--tint); color: var(--ink); }
.badge.gray { background: #f1f3f5; color: var(--ink-2); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }

/* ---- Forms ---- */
.form-grid { display: grid; grid-template-columns: 1fr; gap: 1.15rem; max-width: 720px; }
/* 품목 표처럼 칸이 많은 폼(기안 작성)은 조금 넓게 쓴다 */
.form-grid.wide { max-width: 960px; }
.form-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem; }
/* 그리드 칸은 기본으로 내용의 최소 폭보다 줄지 않는다. 그래서 칸 안의 넓은 표가 폼 전체를 화면 밖으로
   밀었다(2026-10-10 E2E, 모바일 지출결의 645px). 칸이 화면 폭을 따르게 하고 넓은 표는 표 안에서 넘기게 한다. */
.form-grid > *, .form-row > *, .doctype-section > *, .line-row > * { min-width: 0; }
/* vertical rhythm inside a doctype section / 결재선 row so each label groups with its OWN
   input below it, not the input above (display:grid keeps JS show/hide via style.display). */
.doctype-section { display: grid; gap: 1.15rem; align-content: start; }
.doctype-section[style*="display: none"], .doctype-section[style*="display:none"] { display: none !important; }
.line-row { display: grid; gap: 1rem; }
.field label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-2); margin-bottom: .45rem; }
.field .hint { font-size: .75rem; color: var(--ink-3); margin-top: .3rem; }
textarea.input { min-height: 150px; resize: vertical; line-height: 1.6; border: 1px solid var(--line); border-radius: var(--radius-ctrl); padding: .6rem .7rem; }
textarea.input:focus { border-color: var(--primary); }
.form-actions { display: flex; gap: .5rem; margin-top: 1.4rem; }

/* ---- Detail / description list (surface contrast, no box border) ---- */
dl.detail { display: grid; grid-template-columns: 150px 1fr; gap: 0; margin: 0; border-radius: var(--radius); overflow: hidden; }
dl.detail dt { background: var(--bg); padding: .75rem .95rem; font-size: .8rem; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line-soft); }
dl.detail dd { padding: .75rem .95rem; margin: 0; border-bottom: 1px solid var(--line-soft); }
dl.detail dt:last-of-type, dl.detail dd:last-of-type { border-bottom: 0; }

/* ---- Pagination (active = #111, not blue) ---- */
.pager { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; margin-top: 1.2rem; }
.pager a, .pager span { min-width: 32px; text-align: center; padding: .38rem .55rem; border-radius: var(--radius-ctrl); font-size: .82rem; color: var(--ink-2); }
.pager a:hover { background: var(--tint); }
.pager .cur { background: var(--ink); color: #fff; font-weight: 700; }

/* ---- Empty / states ---- */
.empty { padding: 3rem 1rem; text-align: center; color: var(--ink-4); font-size: .875rem; }
.empty svg { width: 48px; height: 48px; color: var(--ink-4); margin-bottom: .6rem; }

/* ---- Flash / toast ---- */
.flash { padding: .75rem 1rem; border-radius: var(--radius-ctrl); margin-bottom: 1rem; font-size: .875rem; font-weight: 600; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--danger-bg); color: var(--danger); }
#toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; align-items: flex-end; gap: .5rem;
    max-width: min(420px, calc(100vw - 40px)); pointer-events: none; }
#toast .t { background: #fff; color: var(--ink); padding: .75rem 1rem; border-radius: var(--radius-ctrl); font-size: .875rem; box-shadow: var(--shadow-floating); font-weight: 600; opacity: 0; transform: translateY(8px); transition: .2s;
    word-break: keep-all; overflow-wrap: anywhere; pointer-events: auto; }
#toast .t.show { opacity: 1; transform: none; }
#toast .t.err { color: var(--danger); }

/* ---- Drawer (right-slide Sheet — replaces centered modals) ------------------
   Overlay + panel structure: head / body(scroll) / foot(hairline top). The shared
   openModal() helper renders into this, so every former modal is now a drawer. */
.drawer-bg { position: fixed; inset: 0; background: rgba(17, 17, 17, .32); opacity: 0; visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease; z-index: 90; }
.drawer-bg.open { opacity: 1; visibility: visible; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 460px; max-width: 94vw; background: var(--surface);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg); box-shadow: var(--shadow-floating);
    display: flex; flex-direction: column; transform: translateX(100%); transition: transform .26s cubic-bezier(.4,0,.2,1); }
.drawer-bg.open .drawer { transform: none; }
.drawer .d-head { padding: 1.15rem 1.4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.drawer .d-head .d-title { font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em; }
.drawer .d-head .d-close { border: 0; background: var(--tint); color: var(--ink-2); width: 30px; height: 30px; border-radius: 999px;
    font-size: 1.05rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.drawer .d-head .d-close:hover { background: rgba(17,17,17,.08); }
.drawer .d-body { padding: .4rem 1.4rem 1.2rem; overflow-y: auto; flex: 1; }
.drawer .d-foot { padding: 1rem 1.4rem; display: flex; justify-content: flex-end; gap: .5rem; border-top: 1px solid var(--line-soft); }
@media (max-width: 560px) { .drawer { width: 100vw; border-radius: 0; } }

/* ---- Date / DateTime picker (CalendarPicker light · DateTimePicker dark) -----
   Enhances native <input type=date|datetime-local>: native input hidden (form
   value kept), .dp-trigger mirrors it, .dp-pop is a floating calendar (+ time
   column for datetime). Matches sufly hub Picker reference. */
.dp { position: relative; width: 100%; }
.dp-trigger { width: 100%; display: flex; align-items: center; gap: .5rem; font-family: inherit; font-size: .9rem;
    color: var(--ink); text-align: left; cursor: pointer; background: var(--tint-2); border: 0; border-radius: var(--radius-ctrl);
    padding: .5rem .7rem; min-height: 38px; transition: background .12s; }
.dp-trigger:hover, .dp-trigger.open { background: var(--tint); }
.dp-trigger svg { width: 15px; height: 15px; color: var(--ink-3); flex-shrink: 0; }
.dp-trigger .dp-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dp-trigger .dp-val.placeholder { color: var(--ink-4); }
.dp-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 75; background: var(--surface);
    border-radius: var(--radius); box-shadow: var(--shadow-floating); padding: .7rem; display: none; }
.dp-pop.open { display: flex; gap: .5rem; }
.dp-cal { width: 250px; }
.dp-cal-head { display: flex; align-items: center; justify-content: space-between; padding: .1rem .1rem .5rem; }
.dp-mon { font-size: .9rem; font-weight: 700; }
.dp-nav { border: 0; background: transparent; color: var(--ink-2); cursor: pointer; width: 28px; height: 28px;
    border-radius: 6px; font-size: 1.05rem; line-height: 1; }
.dp-nav:hover { background: var(--tint); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd { text-align: center; font-size: .7rem; font-weight: 600; color: var(--ink-3); padding: .25rem 0; }
.dp-wd.sun { color: var(--danger); } .dp-wd.sat { color: var(--info); }
.dp-day { text-align: center; font-size: .8rem; padding: .42rem 0; border-radius: 999px; cursor: pointer; color: var(--ink);
    font-variant-numeric: tabular-nums; }
.dp-day:hover { background: var(--tint); }
.dp-day.other { color: var(--ink-4); }
.dp-day.today { box-shadow: inset 0 0 0 1px var(--line); }
.dp-day.sun { color: var(--danger); } .dp-day.sat { color: var(--info); }
.dp-day.selected, .dp-day.selected.sun, .dp-day.selected.sat { background: var(--accent); color: #fff; font-weight: 700; }
/* 범위 선택(시작~종료) */
.dp-day.in-range { background: var(--tint-2); border-radius: 0; color: var(--ink); }
.dp-day.range-start { border-radius: 999px 0 0 999px; }
.dp-day.range-end { border-radius: 0 999px 999px 0; }
.dp-day.range-start.range-end { border-radius: 999px; }
.date-range { position: relative; }
/* dark variant (DateTimePicker) */
.dp-pop.dark { background: #18181b; }
.dp-pop.dark .dp-mon, .dp-pop.dark .dp-day { color: #e7e7ea; }
.dp-pop.dark .dp-nav { color: #b8b8bf; } .dp-pop.dark .dp-nav:hover { background: rgba(255,255,255,.08); }
.dp-pop.dark .dp-wd { color: #8e8e96; }
.dp-pop.dark .dp-day:hover { background: rgba(255,255,255,.08); }
.dp-pop.dark .dp-day.other { color: #5e5e66; }
.dp-pop.dark .dp-day.today { box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.dp-pop.dark .dp-wd.sun, .dp-pop.dark .dp-day.sun { color: #ff8a8a; }
.dp-pop.dark .dp-wd.sat, .dp-pop.dark .dp-day.sat { color: #8ab4ff; }
.dp-pop.dark .dp-day.selected { background: var(--accent); color: #fff; }
.dp-time { width: 86px; border-left: 1px solid rgba(255,255,255,.1); padding-left: .35rem; max-height: 250px; overflow-y: auto;
    display: flex; flex-direction: column; }
.dp-time-h { font-size: .75rem; color: #8e8e96; padding: .1rem .4rem .35rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; position: sticky; top: 0; background: #18181b; }
.dp-slot { padding: .34rem .5rem; font-size: .78rem; color: #d0d0d6; border-radius: 6px; cursor: pointer; text-align: center;
    font-variant-numeric: tabular-nums; }
.dp-slot:hover { background: rgba(255,255,255,.08); }
.dp-slot.selected { background: var(--accent); color: #fff; font-weight: 700; }
@media (max-width: 560px) { .dp-pop.open { flex-direction: column; } .dp-time { width: 250px; border-left: 0; max-height: 150px; flex-direction: row; flex-wrap: wrap; } }

/* button icon: injected leading <svg> + label <span> (see app.js enhanceButtons) */
.btn > svg { flex-shrink: 0; }
.btn > span { display: inline; }

/* ---- Custom checkbox (no native chrome) ---- */
input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 17px; height: 17px; min-width: 17px;
    margin: 0 .1rem 0 0; border: 1.5px solid var(--line); border-radius: 5px; background: var(--surface); cursor: pointer;
    position: relative; vertical-align: -3px; flex-shrink: 0; transition: background .12s, border-color .12s; }
input[type="checkbox"]:hover { border-color: var(--ink-4); }
input[type="checkbox"]:checked { background: var(--primary); border-color: var(--primary); }
input[type="checkbox"]:checked::after { content: ""; position: absolute; left: 4.5px; top: 1px; width: 5px; height: 9px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- Number: hide native spinners (clean bottom-line look) ---- */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---- Month grid (MonthPicker) + time columns (TimePicker) — reuse .dp / .dp-pop ---- */
.dp-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 216px; }
.dp-mo { text-align: center; padding: .6rem 0; border-radius: 8px; cursor: pointer; font-size: .82rem; color: var(--ink);
    font-variant-numeric: tabular-nums; }
.dp-mo:hover { background: var(--tint); }
.dp-mo.selected { background: var(--accent); color: #fff; font-weight: 700; }
.dp-timecols { display: flex; gap: .3rem; }
.dp-col { width: 60px; max-height: 216px; overflow-y: auto; display: flex; flex-direction: column; }
.dp-col-h { font-size: .75rem; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    padding: .1rem .4rem .35rem; position: sticky; top: 0; background: var(--surface); text-align: center; }
.dp-t { padding: .34rem .5rem; font-size: .8rem; color: var(--ink-2); border-radius: 6px; cursor: pointer; text-align: center;
    font-variant-numeric: tabular-nums; }
.dp-t:hover { background: var(--tint); }
.dp-t.selected { background: var(--accent); color: #fff; font-weight: 700; }

/* ---- Info grid (CRM-style read view: section title + 4-col label/value) ------ */
.info-section + .info-section { margin-top: 1.4rem; }
.info-title { font-size: .8rem; font-weight: 700; color: var(--ink-3); padding: 0 0 .55rem; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: .5rem; }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.info-grid.cols-1 { grid-template-columns: 1fr; }
.info-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.info-cell { padding: .8rem 1.1rem .8rem 0; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.info-cell .k { font-size: .76rem; color: var(--ink-3); margin-bottom: .32rem; }
.info-cell .v { font-size: .9rem; font-weight: 650; color: var(--ink); word-break: break-word; line-height: 1.5;
    display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.info-cell .v.pre { display: block; white-space: pre-wrap; font-weight: 500; color: var(--ink-2); }
.info-cell .v a { color: var(--accent); display: inline-flex; align-items: center; gap: .3rem; }
.info-cell .v .muted { font-weight: 500; }
/* 연차 현황(docs/25): 잔여 값만 크게, 음수(선사용)는 빨강 */
.info-cell .v.big { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.info-cell .v.neg { color: var(--danger); }
.leave-grid .info-cell .v { font-variant-numeric: tabular-nums; }
/* 연차 정책 화면(docs/26 §3 · §4): 체크박스 한 줄 · 정책 칸 배치 · 일수 입력 칸 */
.check-line { display: flex; align-items: center; gap: .55rem; padding: .45rem 0; font-size: .875rem; color: var(--ink); cursor: pointer; }
.check-line .muted { font-size: .8rem; }
.policy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem 2.2rem; }
@media (max-width: 860px) { .policy-grid { grid-template-columns: 1fr; } }
/* 경비 집계(docs/24 §5.2 2-4): 묶음 표를 두 칸씩 놓고, 좁은 화면에서는 한 칸 */
.expense-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 1080px) { .expense-grid { grid-template-columns: 1fr; } }
/* HR 인사이트(docs/27 4-2): 값 옆 가로 막대(외부 차트 없이 CSS 로만) · 전월 대비 · 팀 × 달 표 */
.ins-section { margin: 1.8rem 0 .7rem; }
.ins-gap { margin-top: 1rem; }
.ins-note { font-size: .8rem; color: var(--ink-3); margin-top: .6rem; }
.ins-delta { font-size: .8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: .2rem; }
.ins-cell { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.ins-cell .v { min-width: 2.8rem; text-align: right; font-variant-numeric: tabular-nums; }
.ins-bar { flex: 1 1 auto; min-width: 40px; max-width: 160px; height: 8px; border-radius: 999px; background: var(--tint); overflow: hidden; }
.ins-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.ins-bar.warn > i { background: var(--warn); }
.ins-bar.mini { display: block; width: 100%; max-width: none; height: 4px; margin-top: .3rem; }
table.grid.ins-matrix th, table.grid.ins-matrix td { padding: .6rem .75rem; }
table.grid.ins-matrix .ins-sticky { position: sticky; left: 0; z-index: 1; background: var(--surface); }
table.grid.ins-matrix thead .ins-sticky { background: var(--surface-2); }
table.grid tr.ins-total td { font-weight: 700; background: var(--surface-2); }
.ins-defs { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr); margin: 0; font-size: .875rem; }
.ins-defs dt { padding: .65rem .9rem .65rem 0; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line-soft); }
.ins-defs dd { padding: .65rem 0; margin: 0; color: var(--ink-2); line-height: 1.6; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
@media (max-width: 620px) {
    .ins-defs { grid-template-columns: minmax(0, 1fr); }
    .ins-defs dt { border-bottom: 0; padding-bottom: .1rem; }
    table.grid.stack-m tr.ins-total td { background: transparent; }
    table.grid.stack-m .ins-cell { justify-content: flex-start; }
    table.grid.stack-m .ins-cell .v { text-align: left; min-width: 2.4rem; }
    /* 카드 안에서 「이름표 · 값 · 막대」를 한 줄에(12개월 카드가 너무 길어지지 않게) */
    table.grid.stack-m.ins-compact td[data-label] { display: flex; align-items: center; gap: .5rem; width: 100%;
        margin: 0; padding: .22rem 0; font-size: .875rem; color: var(--ink); }
    table.grid.stack-m.ins-compact tbody td[data-label]::before { flex: 0 0 8.5rem; margin: 0; }
    table.grid.stack-m.ins-compact td[data-label] .ins-cell { flex: 1 1 auto; }
}
.input.days { width: 76px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 1080px) { .info-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .info-grid { grid-template-columns: 1fr; } }
/* 숫자 요약 칸(keep-2): 휴대폰에서도 두 칸씩 두어 아래 탭 줄이 너무 밀리지 않게 한다(docs/49) */
@media (max-width: 620px)  { .info-grid.keep-2 { grid-template-columns: repeat(2, 1fr); } .info-grid.keep-2 .info-cell { padding-right: .6rem; } .info-grid.keep-2 .v.big { font-size: 1.05rem; } }

/* ---- File dropzone (grey surface, no dashed border; accent ring on drag) ----- */
.dropzone { border: 0; background: var(--tint-2); border-radius: var(--radius-ctrl); padding: 1.15rem 1rem; text-align: center;
    cursor: pointer; transition: background .15s, box-shadow .15s; }
.dropzone:hover { background: var(--tint); }
.dropzone.drag { background: color-mix(in srgb, var(--accent) 9%, transparent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.dropzone .dz-ico { width: 24px; height: 24px; color: var(--ink-3); margin: 0 auto .45rem; display: block; }
.dropzone .dz-main { font-size: .82rem; color: var(--ink-2); font-weight: 600; }
.dropzone .dz-main b { color: var(--accent); font-weight: 700; }
.dropzone .dz-sub { font-size: .75rem; color: var(--ink-4); margin-top: .25rem; }
.dz-files { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; justify-content: center; }
.dz-chip { display: inline-flex; align-items: center; gap: .4rem; background: var(--surface); border-radius: 999px;
    padding: .25rem .6rem .25rem .7rem; font-size: .75rem; color: var(--ink-2); font-weight: 500; }
.dz-chip svg { width: 13px; height: 13px; color: var(--ink-3); }
.dz-chip .dz-x { cursor: pointer; color: var(--ink-4); font-size: .95rem; line-height: 1; }
.dz-chip .dz-x:hover { color: var(--danger); }

/* ---- Rich-text editor (TipTap) — replaces textarea.rte -----------------------
   Thin box (consistent with textarea treatment) + hairline-divided toolbar. */
.rich img { max-width: 100%; height: auto; border-radius: 8px; }
.rte { border: 1px solid var(--line); border-radius: var(--radius-ctrl); background: var(--surface); overflow: hidden; }
.rte:focus-within { border-color: var(--primary); }
.rte-toolbar { display: flex; gap: .1rem; padding: .3rem; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.rte-tb { border: 0; background: transparent; color: var(--ink-2); min-width: 28px; height: 28px; padding: 0 .4rem;
    border-radius: 6px; cursor: pointer; font-size: .82rem; font-weight: 700; display: grid; place-items: center; }
.rte-tb:hover { background: var(--tint); }
.rte-tb.active { background: var(--tint); color: var(--ink); }
/* HTML 소스 모드 */
.rte .rte-src { margin-left: auto; font-size: .75rem; font-weight: 700; letter-spacing: .04em; }
.rte textarea.rte-source { display: block; width: 100%; border: 0; outline: none; padding: .8rem;
    min-height: 220px; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .8rem;
    line-height: 1.5; resize: vertical; background: var(--surface); color: var(--ink); }
.rte-tb.i { font-style: italic; } .rte-tb.u { text-decoration: underline; } .rte-tb.s { text-decoration: line-through; }
.rte-tb.sep { pointer-events: none; color: var(--line); padding: 0 .1rem; }
.rte-content { min-height: 120px; max-height: 420px; overflow-y: auto; padding: .65rem .8rem; font-size: .9rem;
    line-height: 1.65; color: var(--ink); outline: none; }
.rte-content:focus { outline: none; }
.rte-content > * { margin: 0 0 .5rem; } .rte-content > *:last-child { margin-bottom: 0; }
.rte-content h2 { font-size: 1.12rem; font-weight: 700; margin: .7rem 0 .4rem; }
.rte-content h3 { font-size: 1rem; font-weight: 700; margin: .6rem 0 .35rem; }
.rte-content ul, .rte-content ol { padding-left: 1.3rem; }
.rte-content blockquote { background: var(--tint-2); border-radius: 6px; padding: .5rem .75rem; color: var(--ink-2); }
.rte-content code { background: var(--tint); border-radius: 4px; padding: .05rem .3rem; font-size: .85em;
    font-family: var(--mono, ui-monospace, monospace); }
.rte-content pre { background: var(--tint); border-radius: 6px; padding: .6rem .75rem; overflow-x: auto; }
.rte-content pre code { background: none; padding: 0; }
.rte-content a { color: var(--accent); }
/* read-view of stored rich HTML (th:utext) — same content rhythm */
.rich { line-height: 1.65; color: var(--ink); }
.rich > *:first-child { margin-top: 0; } .rich > *:last-child { margin-bottom: 0; }
.rich h2 { font-size: 1.12rem; font-weight: 700; margin: .7rem 0 .4rem; }
.rich h3 { font-size: 1rem; font-weight: 700; margin: .6rem 0 .35rem; }
.rich ul, .rich ol { padding-left: 1.3rem; margin: 0 0 .5rem; }
.rich p { margin: 0 0 .5rem; }
.rich blockquote { background: var(--tint-2); border-radius: 6px; padding: .5rem .75rem; color: var(--ink-2); margin: 0 0 .5rem; }
.rich code { background: var(--tint); border-radius: 4px; padding: .05rem .3rem; font-size: .85em; }
.rich a { color: var(--accent); }

/* ---- Popover select (custom — replaces native <select> chrome) --------------
   Native <select> stays in the DOM (hidden) for form submit + change events;
   .pop-select mirrors it with a trigger + floating list. Enhanced by app.js. */
.pop-select { position: relative; width: 100%; }
.pop-select > select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pop-trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    font-family: inherit; font-size: .9rem; color: var(--ink); text-align: left; cursor: pointer;
    background: var(--tint-2); border: 0; border-radius: var(--radius-ctrl); padding: .5rem .7rem; min-height: 38px; transition: background .12s; }
.pop-trigger:hover { background: var(--tint); }
.pop-trigger.open { background: var(--tint); }
.pop-trigger .pt-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-trigger .pt-val.placeholder { color: var(--ink-4); }
.pop-trigger .pt-caret { flex-shrink: 0; width: 14px; height: 14px; color: var(--ink-3); transition: transform .18s; }
.pop-trigger.open .pt-caret { transform: rotate(180deg); }
.pop-list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 70; background: var(--surface);
    border-radius: var(--radius); box-shadow: var(--shadow-floating); max-height: 264px; overflow-y: auto; padding: .3rem;
    display: none; }
.pop-list.open { display: block; }
.pop-item { padding: .5rem .65rem; border-radius: 6px; font-size: .875rem; color: var(--ink-2); cursor: pointer;
    display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.pop-item:hover { background: var(--tint-2); color: var(--ink); }
.pop-item.selected { background: var(--tint); color: var(--ink); font-weight: 600; }
/* 키보드로 이동 중인 항목, 키보드 포커스 위치(마우스 클릭 때는 테두리를 그리지 않는다) */
.pop-item.active { background: var(--tint-2); color: var(--ink); }
.pop-trigger:focus-visible, .dp-trigger:focus-visible, .btn:focus-visible, .nav-toggle:focus-visible,
.d-close:focus-visible, .dropzone:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pop-item.selected::after { content: "✓"; font-size: .8rem; color: var(--primary); }

/* user picker (이름/팀 검색 → hidden idx) — shares the floating-list look of .pop-list */
.user-picker { position: relative; }
.up-pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 70; background: var(--surface);
    border-radius: var(--radius); box-shadow: var(--shadow-floating); max-height: 264px; overflow-y: auto; padding: .3rem; display: none; }
.up-pop.open { display: block; }
.up-item { padding: .5rem .65rem; border-radius: 6px; cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.up-item:hover { background: var(--tint-2); }
.up-item .up-name { font-size: .875rem; color: var(--ink); font-weight: 600; }
.up-item .up-meta { font-size: .78rem; color: var(--ink-3); white-space: nowrap; }
.up-empty { padding: .6rem .65rem; font-size: .82rem; color: var(--ink-4); }

/* 모바일 메뉴 열기 버튼: 820px 이하에서만 보인다 (사이드바가 화면 밖으로 숨는 폭) */
.nav-toggle { display: none; width: 44px; height: 44px; margin-left: -.6rem; border: 0; background: none; color: var(--ink);
    border-radius: 8px; cursor: pointer; place-items: center; }
.nav-toggle svg { width: 22px; height: 22px; }
.nav-backdrop { display: none; position: fixed; inset: 0; z-index: 55; background: rgba(17, 17, 17, .35); }
.nav-backdrop.open { display: block; }

@media (max-width: 820px) {
    .sidebar { position: fixed; z-index: 60; transform: translateX(-100%); transition: .2s; }
    .sidebar.open { transform: none; }
    .content { padding: 1rem; }
    .nav-toggle { display: inline-grid; }
    .topbar { padding: 0 1rem; }
    .topbar .crumb { display: flex; align-items: center; gap: .3rem; min-width: 0; }
}

/* ---- 화면 안 언더바 탭(data-tabs, 2026-10-13 UX 정리, docs/49) --------------------------------
   한 화면에 세로로 쌓이던 구역을 언더바 탭으로 나눈다. 탭 줄은 .tabs.line 모양을 그대로 쓰고, 고른 구역(data-tab-panel)만 보인다.
   쓰는 법: 같은 부모 안에 <nav class="tabs line" data-tabs> + <button class="tab" data-tab="키"> 와 형제 <section data-tab-panel="키">.
   처음 보일 구역 말고는 hidden 을 붙여 둔다(스크립트 전에 깜박이지 않게). 고른 탭은 주소 ?tab=키 로 남는다(app.js initTabs). */
.tabs.line[data-tabs] { position: sticky; top: 56px; z-index: 5; background: var(--bg); margin-bottom: 1rem; }
.tabs .tab:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: 6px 6px 0 0; }
/* 버튼 탭도 링크 탭처럼 한 줄로 두고, 넘치면 탭 줄을 옆으로 민다(좁은 화면에서 글자가 꺾이지 않게) */
.tabs .tab { white-space: nowrap; flex-shrink: 0; }
[data-tab-panel][hidden] { display: none !important; }
[data-tab-panel] > :first-child { margin-top: 0; }
/* #아이디로 옮겨 갈 때 상단 바(56px)와 따라오는 탭 줄 밑에 가리지 않게 */
[data-tab-panel] [id], [data-tab-panel][id] { scroll-margin-top: 7rem; }
/* 링크 탭 줄 바로 아래 화면 안 탭 줄이 오면 두 밑줄이 붙어 보이지 않게 아래 줄을 조금 작게 띄운다 */
.tabs.line:not([data-tabs]) + .tabs.line[data-tabs] { margin-top: -.35rem; border-bottom-color: transparent; }
.tabs.line:not([data-tabs]) + .tabs.line[data-tabs] .tab { font-size: .8125rem; padding: .45rem .7rem; }
[data-tab-panel] > .card + .card, [data-tab-panel] > .card + section, [data-tab-panel] > section + .card { margin-top: 1rem; }
@media (max-width: 820px) {
    .tabs.line[data-tabs] { margin-left: -1rem; margin-right: -1rem; padding: 0 1rem; scrollbar-width: none; }
    .tabs.line[data-tabs]::-webkit-scrollbar { display: none; }
}

/* ---- 결재함 (approval inbox · detail) ------------------------------------------
   탭 = 언더바 + 건수 pill, 필터 바 = 흰 면 위 하단선 인풋, 강조 안내(callout) = 시맨틱 면,
   결재 버튼 줄(action-bar) = 모바일에서 화면 아래 고정(버튼 44px 이상). 외곽선 · 그림자 없음. */
.tabs.line { display: flex; gap: .15rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs a.tab { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; white-space: nowrap; }
.tabs .tab .cnt { min-width: 22px; padding: 0 .45rem; border-radius: 999px; background: var(--tint); color: var(--ink-3);
    font-size: .75rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.tabs .tab.active .cnt { background: var(--ink); color: #fff; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .7rem 1rem; background: var(--surface);
    border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: 1rem; }
.filter-bar .f { display: flex; flex-direction: column; gap: .3rem; flex: 1 1 140px; min-width: 130px; }
.filter-bar .f.wide { flex: 2 1 220px; }
.filter-bar .f > label { font-size: .75rem; font-weight: 600; color: var(--ink-3); }
.filter-bar .f.range { flex: 2 1 300px; min-width: 260px; }
.filter-bar .f.range > div { display: flex; align-items: center; gap: .4rem; }
.filter-bar .f.range > div > * { min-width: 0; }
.filter-bar .f.range .dp { flex: 1 1 0; }
.filter-bar .actions { display: flex; gap: .4rem; align-items: center; }
.list-meta { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .6rem;
    flex-wrap: wrap; font-size: .82rem; color: var(--ink-3); }
.list-meta .sort a { color: var(--ink-3); text-decoration: none; padding: .2rem .45rem; border-radius: var(--radius-ctrl); }
.list-meta .sort a.on { color: var(--ink); background: var(--tint); font-weight: 700; }
table.grid td.title-cell { white-space: normal; min-width: 220px; }
table.grid td .sub { display: block; font-size: .75rem; color: var(--ink-3); margin-top: .15rem; }
.pager .gap { color: var(--ink-4); }
.callout { border-radius: var(--radius); padding: .9rem 1.1rem; background: var(--surface); margin-bottom: 1rem; }
.callout.danger { background: var(--danger-bg); }
.callout.danger .c-title { color: var(--danger); }
.callout.warn { background: var(--warn-bg); }
.callout.warn .c-title { color: var(--warn); }
.callout.ok { background: var(--ok-bg); }
.callout.ok .c-title { color: var(--ok); }
.callout .c-title { font-weight: 700; font-size: .875rem; margin-bottom: .3rem; }
.callout .c-body { font-size: .875rem; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.callout .c-meta { font-size: .75rem; color: var(--ink-3); margin-top: .35rem; }
.doc-nav { display: flex; gap: .4rem; flex-wrap: wrap; }
.ref-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.ref-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px;
    background: var(--tint); font-size: .8rem; color: var(--ink-2); }
.ref-chip .muted { font-size: .75rem; }
.action-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; background: var(--surface);
    border-radius: var(--radius); padding: .8rem 1.1rem; margin-top: 1rem; }
.action-bar .spacer { flex: 1; }
.action-bar .hint { font-size: .8rem; color: var(--ink-3); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
@media (max-width: 820px) {
    .action-bar { position: sticky; bottom: 0; z-index: 30; margin: 1rem -1rem 0; border-radius: 0;
        border-top: 1px solid var(--line); padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom)); }
    .action-bar .spacer, .action-bar .hint { display: none; }
    .action-bar .btn { min-height: 44px; flex: 1 1 28%; justify-content: center; white-space: nowrap; }
    .filter-bar .f, .filter-bar .f.wide { flex: 1 1 100%; }
    .filter-bar .actions { width: 100%; }
    .filter-bar .actions .btn { flex: 1 1 0; justify-content: center; min-height: 44px; }
    .table-wrap.scroll-x { overflow-x: auto; }
}
@media (max-width: 620px) {
    .form-row.two { grid-template-columns: 1fr; }
    /* 좁은 헤더: 출근 상태·이름·퇴근 타이머는 숨기고 알림·아바타·로그아웃만 남겨 글자가 세로로 쪼개지지 않게 */
    .topbar .hd-status, .topbar .hd-name, .topbar .offclock { display: none !important; }
    .topbar .hd-approval .hd-approval-text { display: none; }
    .topbar .user { gap: .5rem; white-space: nowrap; }
    .topbar .crumb > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* 폼 안내 문구(성공·오류). 로그인 화면과 같은 의미의 공통 버전 */
.msg { font-size: .875rem; padding: .65rem .8rem; border-radius: 8px; margin: .2rem 0 1rem; }
.msg.ok { background: var(--tint-2); color: var(--ink); }
.msg.err { background: #fdecec; color: var(--danger); }

/* 표 안의 음수 값(연차 선사용 등) */
.neg-text { color: var(--danger); }

/* 머리 버튼 줄(사용자 상세 등): 좁은 화면에서는 줄을 바꾸고, 버튼 글자는 한 줄로 둔다 */
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.head-actions .btn { white-space: nowrap; }

/* ---- 입력 품목 표(지출결의 · 품의): 칸 안 여백을 줄이고 내용 칸을 넓힌다 ---------------------
   열 폭은 <colgroup> 이 정한다. 영수증 칸의 파일 선택 영역은 작은 버튼 크기로 줄인다. */
table.grid.item-table { table-layout: fixed; }
table.grid.item-table th, table.grid.item-table td { padding: .55rem .6rem; white-space: normal; }
table.grid.item-table td .btn { white-space: nowrap; }
table.grid.item-table td .dropzone { padding: .45rem .5rem; }
table.grid.item-table td .dropzone .dz-ico, table.grid.item-table td .dropzone .dz-sub { display: none; }
table.grid.item-table td .dropzone .dz-main { font-size: .75rem; line-height: 1.35; }
table.grid.item-table td .dz-files { margin-top: .35rem; }

/* ---- 좁은 화면에서 표를 줄마다 카드로 쌓기(stack-m) -----------------------------------------
   <table class="grid stack-m"> 의 각 칸에 data-label 을 달면 그 이름이 값 위에 작게 붙는다.
   행 단위 버튼(삭제 · 취소)이 있는 칸에는 .stack-act 를 달아 카드 오른쪽 위에 둔다.
   표를 감싼 .table-wrap 에는 .stack-wrap 을 함께 단다(카드 사이 바탕이 보이게). */
@media (max-width: 620px) {
    .table-wrap.stack-wrap { background: transparent; overflow: visible; border-radius: 0; }
    table.grid.stack-m { table-layout: auto; }
    table.grid.stack-m thead { display: none; }
    table.grid.stack-m, table.grid.stack-m tbody, table.grid.stack-m tr, table.grid.stack-m td { display: block; width: 100%; }
    table.grid.stack-m tbody tr { position: relative; background: var(--bg); border-radius: var(--radius-ctrl);
        padding: .55rem .85rem .7rem; margin-bottom: .6rem; }
    table.grid.stack-m tbody tr:hover { background: var(--bg); }
    table.grid.stack-m tbody td { border: 0 !important; padding: .3rem 0; white-space: normal; text-align: left;
        word-break: keep-all; overflow-wrap: anywhere; }
    table.grid.stack-m td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem;
        font-weight: 600; color: var(--ink-3); margin-bottom: .15rem; }
    table.grid.stack-m td.stack-head { font-weight: 700; padding-right: 5.5rem; }
    table.grid.stack-m td.stack-act { position: absolute; top: .45rem; right: .6rem; width: auto; padding: 0; }
    table.grid.stack-m td.stack-act:empty { display: none; }
    table.grid.stack-m td.stack-act .btn { min-height: 36px; }
    /* 품목 표의 번호 칸은 「품목 1」로 읽히게 한다 */
    table.grid.item-table.stack-m td.stack-head::before { content: '품목 '; }
    /* 내 정정 요청(근태): 상태는 카드 머리에 붙여 보이고, 따로 있던 상태 칸 · 빈 처리 칸은 감춘다 */
    table.grid.stack-m td.gcr-status, table.grid.stack-m td.gcr-empty { display: none; }
}
/* 넓은 화면에서는 상태를 제 칸에만 보인다 */
@media (min-width: 621px) { .gcr-status-m { display: none; } }

/* ---- 카드형 표(stack-m) 보조 ------------------------------------------------------------
   .stack-title  카드 제목 줄(오른쪽 버튼 자리를 비우지 않는다. 버튼이 있는 표는 .stack-head)
   .stack-meta   카드 아래 한 줄에 나란히 놓는 짧은 값(작성자 · 조회 · 날짜). 이름표는 값 앞에 붙는다
   .hide-m       좁은 화면 카드에서 빼는 칸(번호처럼 카드에서는 의미가 없는 값)
   .show-m       좁은 화면에서만 보이는 조각(빠진 칸의 값을 제목 줄에 다시 붙일 때) */
.show-m { display: none !important; }
@media (max-width: 620px) {
    .show-m { display: inline-flex !important; }
    table.grid.stack-m td.hide-m { display: none; }
    table.grid.stack-m td.stack-title { font-weight: 700; }
    table.grid.stack-m td.stack-meta { display: inline-block; width: auto; margin-right: .9rem; padding: .15rem 0;
        font-size: .8125rem; color: var(--ink-3); }
    table.grid.stack-m td.stack-meta[data-label]::before { display: inline; margin: 0 .3rem 0 0; font-size: .75rem; }
    table.grid.stack-m td.stack-meta:empty { display: none; }
    table.grid.stack-m td.stack-meta .sub { display: inline; margin: 0 0 0 .3rem; }
    /* 흰 카드 밖(페이지 바탕 위)에 놓인 표는 카드를 흰색으로(바탕과 같은 회색이면 경계가 보이지 않는다) */
    .table-wrap.stack-wrap.on-page table.grid.stack-m tbody tr,
    .table-wrap.stack-wrap.on-page table.grid.stack-m tbody tr:hover { background: var(--surface); }
    table.grid.stack-m td.stack-full { overflow-wrap: anywhere; }
}
/* 제목 옆 상태 뱃지 묶음(게시판 예약 · 만료 · 대상 팀) */
.board-flags { display: inline-flex; flex-wrap: wrap; gap: .3rem; margin-left: .4rem; vertical-align: middle; }
/* 체크 목록(조회 대상 팀 고르기 등): 좁은 화면에서는 한 줄에 하나 */
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .35rem 1rem;
    max-height: 260px; overflow-y: auto; padding: .6rem .8rem; background: var(--bg); border-radius: var(--radius-ctrl); }
.check-list label { display: flex; align-items: center; gap: .45rem; font-size: .875rem; color: var(--ink); margin: 0;
    min-height: 32px; cursor: pointer; }
.check-list input[type=checkbox] { width: auto; accent-color: var(--primary); }
.radio-row { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.radio-row label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-size: .875rem; color: var(--ink);
    min-height: 32px; cursor: pointer; }
.radio-row input[type=radio], .radio-row input[type=checkbox] { width: auto; accent-color: var(--primary); }
.radio-row label.is-off { color: var(--ink-4); cursor: not-allowed; }
/* 화면에서는 숨기고 화면 읽기 프로그램에는 읽히는 이름표 */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---- 내 정보 · 정보 변경 요청 처리(V55) ---------------------------------------------------
   항목 하나 = .pf-item(머리 줄 + 칸 묶음), 요청 한 건 = .pf-req(머리 줄 + 항목 표). 외곽선 없이 헤어라인으로만 나눈다. */
.pf-item { padding: .9rem 0; border-bottom: 1px solid var(--line-soft); }
.pf-item:last-of-type { border-bottom: 0; }
.pf-head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-bottom: .55rem; }
.pf-now { font-size: .8125rem; color: var(--ink-3); overflow-wrap: anywhere; }
.pf-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem 1rem; max-width: 520px; }
.pf-fields.multi { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; }
@media (max-width: 760px) { .pf-fields.multi { grid-template-columns: minmax(0, 1fr); } }
.pf-item.is-pending .input { opacity: .55; }
.pf-req { padding: .9rem 0; border-top: 1px solid var(--line-soft); }
.pf-req:first-of-type { border-top: 0; padding-top: .2rem; }
.pf-req-head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-bottom: .55rem; font-size: .8125rem; }
.pf-req-head .spacer { flex: 1; }
.pf-req-head .who { font-size: .9375rem; font-weight: 700; color: var(--ink); }
.pf-decide { display: flex; flex-direction: column; gap: .4rem; min-width: 180px; }
.pf-decide .input { min-width: 0; }
.pf-note { display: block; margin-top: .3rem; font-size: .75rem; color: var(--warn); white-space: normal; }
.pf-req-foot { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .6rem; }
@media (max-width: 620px) { .pf-req-foot .btn { flex: 1 1 auto; justify-content: center; min-height: 44px; } }

/* ---- 운영 홈 · 월 마감 점검표(docs/47) ----------------------------------------------------------
   「오늘 할 일」 칸 = .ops-tile(면 대비만, 외곽선 · 그림자 없음). 숫자는 .ops-num(있으면 warn, 0 이면 흐리게, 실패는 danger). */
.ops-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; }
.ops-tile { display: flex; flex-direction: column; gap: .2rem; padding: .8rem .95rem; border-radius: var(--radius-ctrl);
    background: var(--bg); color: var(--ink); text-decoration: none; min-width: 0; }
.ops-tile:hover { background: var(--tint); }
.ops-tile .ops-area { font-size: .75rem; color: var(--ink-3); font-weight: 600; }
.ops-tile .ops-title { font-size: .875rem; font-weight: 650; overflow-wrap: anywhere; }
.ops-tile .ops-num { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.25; color: var(--ink-4); }
.ops-tile .ops-num.warn { color: var(--warn); }
.ops-tile .ops-num.danger { font-size: .875rem; font-weight: 700; color: var(--danger); padding: .35rem 0; }
.ops-tile .ops-note { font-size: .75rem; color: var(--ink-3); overflow-wrap: anywhere; }
.ops-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.ops-cols > .card { margin: 0; }
.ops-list { list-style: none; margin: 0; padding: 0; }
.ops-list li { padding: .55rem 0; border-bottom: 1px solid var(--line-soft); font-size: .875rem; overflow-wrap: anywhere; }
.ops-list li:last-child { border-bottom: 0; }
.ops-list .meta { font-size: .75rem; color: var(--ink-3); }
.ops-noti + .ops-noti { margin-top: .9rem; }
.ops-progress { display: flex; align-items: center; gap: .7rem; margin: .5rem 0 .3rem; }
.ops-progress .ins-bar { max-width: none; height: 10px; }
.ops-progress .v { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cl-why { font-size: .75rem; color: var(--ink-3); margin-top: .25rem; overflow-wrap: anywhere; white-space: normal; }
.cl-actions { display: flex; flex-wrap: wrap; gap: .3rem; }
@media (max-width: 900px) { .ops-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 620px) {
    .ops-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ops-tile .ops-num { font-size: 1.3rem; }
    .cl-actions .btn { min-height: 40px; }
}
