/* ============================================
   NFP 푸드트럭 관리 시스템 — 메인 CSS
   모바일 퍼스트 / 라이트-다크 테마
   Apple + Sci-Fi 미니멀 스타일
   ============================================ */

/* --- 본문 글꼴: Pretendard (static/fonts, OFL-1.1) ---
   설치 안 된 PC 는 한글이 맑은 고딕으로 떨어져 옛날 화면처럼 보였다 → 서버가 직접 내려준다(외부 CDN 없음, 11-03).
   가변 폰트 한 파일에 100~900 굵기가 다 들어 있다. swap: 받는 동안 시스템 글꼴로 먼저 그린다. */
@font-face {
    font-family: 'Pretendard Variable';
    font-weight: 45 920;
    font-style: normal;
    font-display: swap;
    src: url('/fonts/PretendardVariable-302ec55f5b4320354ec6b35a53dead87.woff2') format('woff2-variations');
}

/* --- CSS 변수 (라이트 테마) --- */
:root {
    --bg:          #f4f5f7;
    --surface:     #ffffff;
    --border:      #e5e6ea;
    --text:        #1d1d1f;
    --text-sub:    #6e6e73;
    --primary:     #2563eb;
    --primary-dk:  #1d4ed8;
    /* 브랜드 색(히어로·출근 버튼·로그인·안드로이드 상태바) — 초록→파랑 전환(2026-09-14).
       그라데이션 끝은 --brand-deep. 성공/상승 등 '의미' 초록(--success, .kpi-delta.up)은 그대로 둔다. */
    --brand:       #2563eb;
    --brand-dk:    #1d4ed8;
    --brand-deep:  #1e3a8a;
    --success:     #16b364;
    --warn:        #ff9f0a;
    --danger:      #ff3b30;
    /* 모서리 — 한 단계씩만 (칩/작은버튼 8 · 카드/입력 12 · 모달 16) */
    --radius:      12px;
    --radius-sm:   8px;
    --radius-lg:   16px;
    /* 그림자 — 카드는 '테두리 + 아주 옅은 그림자'로 눌러두고,
       진짜 떠 있는 것(모달·팝오버·드롭다운)에만 --shadow-lg 를 쓴다.
       색 있는 글로우는 쓰지 않는다(브랜드색과 액션색이 다른 화면에서 튄다). */
    --shadow:      0 1px 2px rgba(16,24,40,.04);
    --shadow-lg:   0 8px 28px rgba(16,24,40,.12);
    --nav-h:       52px;
    --font:        'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo',
                   'Malgun Gothic', sans-serif;
}

/* --- 다크 테마 (Sci-Fi 고대비) --- */
.theme-dark {
    --bg:          #000000;
    --surface:     #1c1c1e;
    --border:      #38383a;
    --text:        #f5f5f7;
    --text-sub:    #aeaeb2;
    --primary:     #3b82f6;
    --primary-dk:  #2563eb;
    --brand:       #3b82f6;
    --brand-dk:    #2563eb;
    --brand-deep:  #1e3a8a;
    --success:     #1ed17a;
    --warn:        #ffd60a;
    --danger:      #ff453a;
    --shadow:      0 1px 2px rgba(0,0,0,.4);
    --shadow-lg:   0 8px 28px rgba(0,0,0,.5);
}

/* --- ⚠ View Transitions(@view-transition) 재도입 금지 ---
   안드로이드 WebView(APK)에서 전환이 끝나지 않아 '옛 페이지 스냅샷'이 화면에 고정되고,
   버튼을 눌러도 앱을 내렸다 올려야(강제 리페인트) 새 화면이 보이는 사고가 두 번 났다
   (2026-08-14 재발). PC 깜빡임 억제 목적이라도 넣지 말 것 — 넣으려면 실기기 검증 필수. */

/* --- 리셋 & 기본 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* scrollbar-gutter: 스크롤바 자리를 늘 비워둔다.
   없으면 내용이 짧아 스크롤바가 안 생기는 화면만 본문이 스크롤바 폭(약 15px)만큼 넓어져,
   사이드바로 화면을 옮길 때마다 좌우가 살짝 늘었다 줄었다 한다.
   (모바일은 오버레이 스크롤바라 폭이 0 → 영향 없음) */
/* height:100% 를 주면 body 가 '화면 높이'에서 끝나고 내용은 그 밖으로 넘친다 →
   sticky 상단바가 body 경계를 지나는 순간 같이 밀려 올라가고 그 자리가 빈다.
   문서 전체 높이를 갖도록 min-height 만 준다. */
html { font-size: 17px; -webkit-tap-highlight-color: transparent; min-height: 100%; scrollbar-gutter: stable; }
/* 11-04 PC 만 글씨 한 단계 키움(17px). 폰은 이미 충분해서 원래 16px 유지 */
@media (max-width: 639.98px) { html { font-size: 16px; } }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background .25s, color .25s;
    /* 표 행 구분선 — 행을 촘촘하게 두면 --border 실선은 줄무늬처럼 시끄러워진다.
       테마 클래스(.theme-dark)와 같은 요소에 선언해야 다크에서도 제 색으로 풀린다. */
    --row-line: color-mix(in srgb, var(--border) 60%, transparent);
}
a { color: var(--primary); text-decoration: none; }
/* 폼 컨트롤 전역 컴팩트 — 16px/44px 기본은 ERP 표·필터 줄에서 너무 컸다(옵션 글자 포함).
   로그인 등 큰 입력이 필요한 화면은 자체 클래스(.auth-field input)로 키운다. */
input, textarea, button, select { font-family: inherit; font-size: .875rem; }
input, textarea, select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    /* 세로 패딩 축소 — 입력칸 높이가 행 높이를 끌어올리던 문제(2026-08-05).
       단 0에 가깝게 줄였더니 입력칸이 셀보다 작아져 테두리 위아래에 빈 공간이 생겼다 → 5px 로 되돌림. */
    padding: 5px 9px;
    width: 100%;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

/* ── 셀렉트 박스 통일 (모던 스타일 · 선 화살표) ── */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 32px;
    padding: 0 32px 0 11px;
    cursor: pointer;
    font-weight: 500;
    background-image: var(--select-arrow, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>"));
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 14px;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
select:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--text) 26%, var(--border));
    background-color: color-mix(in srgb, var(--text) 3.5%, var(--surface));
}
/* 다크는 화살표 색만 바꾼다 — 예전엔 '.theme-dark select' 로 이미지를 다시 깔아 우선순위가 올라가, 'background:' 단축을
   쓰는 셀렉트(목록 'N건씩' 등)에서 반복·위치가 풀려 화살표가 칸 전체에 깔렸다(10-03 현장 다크모드) */
.theme-dark {
    --select-arrow: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23aeaeb2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
}
select.select-sm { height: 28px; padding: 0 26px 0 9px; font-size: .8rem; background-position: right 7px center; background-size: 12px; }
select:disabled { opacity: .55; cursor: not-allowed; }
/* 작은 on/off 스위치 — '(퇴사자 ⬭)' 처럼 라벨 옆에 붙는 보조 토글(매출 조회·회원관리, 10-04) */
.mini-switch { position: relative; display: inline-block; width: 28px; height: 16px; vertical-align: middle; }
.mini-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.mini-switch span { position: absolute; inset: 0; background: var(--border); border-radius: 16px; transition: background .2s; cursor: pointer; }
.mini-switch span::before { content: ''; position: absolute; width: 12px; height: 12px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .2s; }
.mini-switch input:checked + span { background: var(--primary); }
.mini-switch input:checked + span::before { transform: translateX(12px); }
/* 옵션 가독성 (지원 브라우저) */
select option { font-weight: 400; padding: 6px 8px; }
/* 표 셀·인라인 필터 안 셀렉트는 열 전체로 늘어지지 않게 내용 폭에 맞춘다 */
.data-table td select, .filter-inline select { width: auto; min-width: 96px; max-width: 240px; }

/* ── 색상 선택 파레트 (네이티브 색 피커의 모바일 하단 잘림 회피 · 중앙 모달 스와치) ── */
.cpick { width: 40px; height: 26px; border-radius: 7px; border: 1px solid var(--border);
    cursor: pointer; padding: 0; vertical-align: middle; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.cpick--inherit { position: relative; }
.cpick-note { font-size: .74rem; color: var(--text-sub); margin-left: 6px; vertical-align: middle; }
.cpal-box { background: var(--surface); border-radius: 16px; padding: 18px 18px 16px;
    width: min(330px, 92vw); box-shadow: 0 16px 48px rgba(0,0,0,.35), 0 0 0 1px var(--border); }
.cpal-title { font-weight: 700; font-size: 1rem; margin-bottom: 14px; }
.cpal-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 16px; }
.cpal-sw { aspect-ratio: 1; border-radius: 10px; border: 2px solid transparent; cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .12s; }
.cpal-sw:hover { transform: scale(1.08); }
.cpal-sw.sel { border-color: var(--surface); box-shadow: 0 0 0 2px var(--text); }
/* 도형·아이콘 스와치(SVG)는 확대 대신 테두리 강조 — overflow 그리드에서 확대는 잘리고 스크롤바가 튀어 틀이 흔들린다 */
.cpal-sw[data-spec] { box-shadow: none; }
.cpal-sw[data-spec]:hover { transform: none; border-color: var(--accent, var(--primary)); }
.cpal-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cpal-custom { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--text-sub); }
.cpal-custom input[type=color] { width: 34px; height: 26px; padding: 0; border-radius: 6px; }
/* 모양 선택 모달 섹션 라벨(테두리 / 아이콘) */
.cpal-sub { font-size: .78rem; font-weight: 700; color: var(--text-sub); margin: 2px 0 6px; }
.cpal-icongrid { max-height: 40vh; overflow-y: auto; scrollbar-gutter: stable; }
/* 테두리 고르기(원/사각/육각/물방울 + 깃발/별) — 고른 테두리 안에 아이콘이 들어간다 */
.cpal-sil-row { display: flex; gap: 6px; margin: 4px 0 10px; flex-wrap: wrap; }
.cpal-sil { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; cursor: pointer;
    border: 1.5px solid var(--border); border-radius: 8px; background: var(--surface);
    color: var(--text); font-size: .8rem; font-weight: 600; }
.cpal-sil:hover { border-color: var(--text-sub); }
.cpal-sil.sel { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.cpal-sil svg { width: 16px; height: 16px; }

/* ── 체크박스/라디오는 전역 input 규격(풀폭·패딩·테두리) 제외 ── */
input[type="checkbox"], input[type="radio"] {
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    -webkit-appearance: auto;
    appearance: auto;
    accent-color: var(--primary);
    cursor: pointer;
    flex: 0 0 auto;        /* flex 컨테이너 안에서 늘어나지 않게 */
    width: 18px;
    height: 18px;
}
input[type="checkbox"]:focus, input[type="radio"]:focus { box-shadow: none; }

/* --- 상단 네비 ---
   모바일에선 어느 화면이든 항상 위에 붙어 있어야 한다(뒤로가기·제목이 늘 손에 닿게).
   PC 는 사이드바가 그 역할을 하므로 고정하지 않는다(아래 1024px 블록에서 static). */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    /* 모바일 앱 edge-to-edge: 상태바(상단 인셋)만큼 바를 키우고 콘텐츠는 그 아래로 밀어 시스템 UI를 안 가린다. */
    height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
    box-sizing: border-box;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: env(safe-area-inset-top, 0px) calc(16px + env(safe-area-inset-right, 0px)) 0 calc(16px + env(safe-area-inset-left, 0px));
    /* background 가 불투명(--surface)이라 블러는 보이지도 않으면서 합성 레이어만 만든다 → 제거 */
}
.nav-logo { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.5px; display:flex; align-items:center;
    color: inherit; text-decoration: none; cursor: pointer; }
.nav-logo-img { height: 36px; width: 36px; object-fit: contain; border-radius: 8px; display: block; }
.nav-title { font-size: 1rem; font-weight: 600; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-username { font-size: .85rem; color: var(--text-sub); }
.btn-back {
    font-size: 20.8px;
    color: var(--primary);
    padding: 4px 8px;
    background: none;
    border: none;
    cursor: pointer;
}

/* --- 페이지 컨테이너 --- */
.page-container {
    /* 하단은 모바일 앱 내비바(하단 인셋)만큼 더 띄워 마지막 항목이 안 가리게 */
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    /* 1440 제한은 와이드 모니터에서 양옆을 놀렸다 — 표 열이 좌우로 퍼지도록 넉넉히 */
    max-width: 1720px;
    margin: 0 auto;
}
/* --- 사이트 푸터 (fragments/footer.html) — 약관·개인정보처리방침·사업자 정보 ---
   개인정보처리방침은 '다른 링크보다 눈에 띄게'(개인정보보호법 30조) → 굵게 + 브랜드색. 나머지는 조용히. */
.site-footer {
    margin-top: 40px; padding: 18px 2px 4px;
    border-top: 1px solid var(--border);
    font-size: .74rem; line-height: 1.6; color: var(--text-sub);
}
.sf-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; }
.sf-links a { color: var(--text-sub); font-size: .8rem; font-weight: 600; text-decoration: none; }
.sf-links a:hover { color: var(--text); }
.sf-links a.sf-privacy { color: var(--primary); font-weight: 800; }
.sf-biz { display: flex; flex-wrap: wrap; gap: 0 14px; }
.sf-biz b { font-weight: 500; color: var(--text); }
.sf-check {
    margin-left: 4px; padding: 0 6px; border: 1px solid var(--border); border-radius: 5px;
    color: var(--text-sub); font-size: .7rem; text-decoration: none; white-space: nowrap;
}
.sf-check:hover { color: var(--text); border-color: var(--text-sub); }
.sf-copy { margin-top: 8px; font-size: .7rem; opacity: .8; }
/* 앱 화면: 내용이 짧아도 푸터가 화면 바닥에 붙게 — 본문이 남는 높이를 먹는다(푸터가 붙은 화면만, sidebar 조각이 클래스를 단다).
   본문은 margin:0 auto 라 flex 안에서 폭이 줄지 않게 width:100% 를 준다. */
body.has-site-footer { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body.has-site-footer > .page-container { width: 100%; flex: 1 0 auto; }
body.has-site-footer > .site-footer-wrap { flex: none; padding-top: 0; }
.site-footer-wrap .site-footer { margin-top: 24px; }

/* 데이터 테이블 페이지(회원/권한 관리 등) — 넓은 화면 여백 활용 */
.page-container--wide { max-width: 1720px; }
.page-title {
    font-size: 22.4px; font-weight: 700; margin-bottom: 4px;
    padding-left: 12px; border-left: 3px solid var(--primary);
}
.page-subtitle { font-size: .85rem; color: var(--text-sub); margin: 0 0 4px 15px; }
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.page-header h2 {
    font-size: 20.8px; font-weight: 700;
    padding-left: 11px; border-left: 3px solid var(--primary);
}

/* ── NFP 커스텀 버튼 시스템 ──
   라운드를 키우고(12px) 굵게(700) 잡아 아이콘 스프라이트와 톤을 맞추고,
   호버 시 살짝 떠오르고 눌렀을 때 확실히 눌리는 촉감으로 "제작사 고유 룩"을 표현한다.
   색은 유지 — 그라데이션·글로우 없이 단색 + 그림자만으로 입체감을 낸다. */
.nfp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    font-size: .92rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: .1px;
    transition: transform .14s, box-shadow .14s, filter .14s, background .14s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    position: relative;
}
.nfp-btn:hover   { transform: translateY(-1px); }
.nfp-btn:active  { transform: translateY(0) scale(.97); }
.nfp-btn--primary { background: var(--primary); color: #fff; box-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 35%, transparent); }
.nfp-btn--primary:hover { background: var(--primary-dk); box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 45%, transparent); }
.nfp-btn--success { background: var(--success); color: #fff; box-shadow: 0 2px 10px color-mix(in srgb, var(--success) 35%, transparent); }
.nfp-btn--warn    { background: var(--warn);    color: #1a1000; }
.nfp-btn--danger  { background: var(--danger);  color: #fff; box-shadow: 0 2px 10px color-mix(in srgb, var(--danger) 35%, transparent); }
.nfp-btn--ghost {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.nfp-btn--ghost:hover { background: var(--bg); border-color: var(--text-sub); }
.nfp-btn--sm  { padding: 6px 14px; font-size: .82rem; border-radius: 9px; }
.nfp-btn--lg  { padding: 14px 28px; font-size: 1rem; border-radius: 14px; }
.nfp-btn--full { width: 100%; }

/* ── 레거시 btn-* 호환 (사이즈/톤 통일) ──
   .nfp-btn과 동일한 룩(라운드 12px·굵기 700·호버 리프트)을 공유 — 페이지마다 들쭉날쭉하던 것 정규화 */
.btn-primary, .btn-secondary, .btn-warn, .btn-danger, .btn-success, .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: none;
    border-radius: 12px;
    font-size: .92rem;
    font-weight: 700;
    line-height: 1;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .14s, box-shadow .14s, filter .14s, background .14s;
    -webkit-tap-highlight-color: transparent;
}
/* 버튼은 단색 — 그라데이션·컬러 글로우 없음(둘 다 화면을 낡아 보이게 하고, 색이 많아질수록 지저분해진다) */
.btn-primary   { background: var(--primary); color:#fff; box-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn-primary:hover { background: var(--primary-dk); transform: translateY(-1px); box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 45%, transparent); }
.btn-secondary { background: var(--surface); color: var(--text);
    border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: var(--text-sub); transform: translateY(-1px); }
.btn-ghost     { background: transparent; color: var(--text-sub);
    border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); transform: translateY(-1px); }
.btn-warn      { background: var(--warn); color:#1a1000; }
.btn-danger    { background: var(--danger); color:#fff; box-shadow: 0 2px 10px color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-success   { background: var(--success); color:#fff; box-shadow: 0 2px 10px color-mix(in srgb, var(--success) 35%, transparent); }
.btn-warn:hover, .btn-danger:hover, .btn-success:hover { filter: brightness(.94); transform: translateY(-1px); }
.btn-primary:active, .btn-secondary:active, .btn-warn:active, .btn-danger:active, .btn-success:active, .btn-ghost:active {
    transform: translateY(0) scale(.97);
}
.btn-logout    { display:inline-flex; align-items:center; justify-content:center;
    background: none; border: 1px solid var(--border); color: var(--text);
    border-radius: 9px; min-height: 34px; padding: 0 12px; cursor: pointer; font-size:.82rem;
    font-weight: 600; font-family: inherit; transition: background .12s; }
.btn-logout:hover { background: var(--bg); }
.btn-icon      { display:inline-flex; align-items:center; justify-content:center;
    width: 38px; height: 38px; background: none; border: none; font-size: 19.2px;
    /* button 은 color 를 상속하지 않아 기본값(검정)이 된다 → 다크모드에서 아이콘이 안 보임. 테마색으로 고정 */
    color: var(--text);
    border-radius: 9px; cursor: pointer; transition: background .12s; }
.btn-icon:hover { background: var(--bg); }
.btn-full      { width: 100%; }
.btn-lg        { min-height: 50px; padding: 0 24px; font-size: 1rem; border-radius: 14px; }
.btn-sm        { min-height: 34px; padding: 0 12px; font-size: .82rem; border-radius: 9px; }
/* 작은 위험 버튼 (목록 내 삭제 등) — 통일 */
.btn-danger-sm, .btn-primary-sm, .btn-secondary-sm {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 34px; padding: 0 12px; border-radius: 9px;
    font-size: .82rem; font-weight: 700; font-family: inherit; cursor: pointer;
    border: none; -webkit-tap-highlight-color: transparent;
    white-space: nowrap;   /* 좁은 표 칸에서 '삭제'가 세로로 꺾이지 않게 */
    transition: transform .12s, filter .12s;
}
.btn-danger-sm    { background: rgba(255,59,48,.12); color: var(--danger); }
.btn-danger-sm:hover { background: rgba(255,59,48,.2); }
.btn-primary-sm   { background: var(--primary); color: #fff; }
.btn-secondary-sm { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-danger-sm:active, .btn-primary-sm:active, .btn-secondary-sm:active { transform: scale(.96); }
/* 눌림은 살짝만 — .96은 버튼이 튀어 보인다 (별도 active 정의가 없는 버튼 전반의 기본값) */
button:active  { transform: scale(.985); }


/* --- 카드 --- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.card-title { font-size: 1rem; font-weight: 600; }
.card-sub   { font-size: .8rem; color: var(--text-sub); margin-bottom: 10px; }
.card-actions { display: flex; gap: 8px; }

/* --- 배지 --- */
.badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 700;
}
.badge-active    { background: #d1fae5; color: #065f46; }
.badge-suspended { background: #fef3c7; color: #92400e; }
.badge-deleted   { background: #fee2e2; color: #991b1b; }
/* 진행 중(파랑) — 완료(녹색 badge-active)와 구분. 발주중 등 "아직 끝나지 않은" 상태 */
.badge-info      { background: #dbeafe; color: #1e40af; }

/* --- 알림 메시지 --- */
.alert {
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: .9rem;
    margin-top: 12px;
}
.alert-error   { background: #fee2e2; color: #991b1b; }
.alert-success { background: #d1fae5; color: #065f46; }
/* 경고 — badge-warn 과 같은 톤. --warn 은 다크테마에서 재정의된다 */
.alert-warn    { background: rgba(255,159,10,.15); color: var(--warn); }

/* --- 보조 안내문 (빈 상태 문구 등) --- */
.hint { font-size: .82rem; color: var(--text-sub); }

/* --- 도움말: 타이틀에 data-hint 를 붙이면 클릭 시 토스트로 보여준다 (main.js showHintToast) --- */
[data-hint] { cursor: pointer; }

/* --- 폼 --- */
.form-group { margin-bottom: 14px; }
/* 모달 안 좌우 페어 — [원단가|현재고] 처럼 두 입력을 한 줄에 (2026-08-22) */
.form-pair { display: flex; gap: 10px; }
.form-pair .form-group { flex: 1; min-width: 0; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-sub); margin-bottom: 5px; }

/* --- 섹션 카드 --- */
.section-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
/* 제목이 워크스페이스 헤더로 빠져 액션 버튼만 남은 헤더 —
   space-between 이라 혼자 남으면 왼쪽으로 붙는다. 버튼은 계속 오른쪽에 둔다. */
.page-header > :only-child { margin-left: auto; }
.section-title {
    font-size: 1rem; font-weight: 700; margin-bottom: 12px;
    padding-left: 9px; border-left: 3px solid var(--primary);
}
.section-desc  { font-size: .85rem; color: var(--text-sub); margin-bottom: 12px; }

/* --- 워크스페이스 탭 스트립 (모듈 상단, 밑줄형) --- */
.ws { margin-bottom: 18px; }
/* 브레드크럼(작은 글씨) — PC 전용. 사이드바에 이미 3단 메뉴가 있어 본문의 큰 제목·탭은 군더더기다.
   모바일은 사이드바가 없어 제목·탭이 길잡이 역할을 하므로 그대로 둔다(아래 미디어쿼리에서 가른다). */
.ws-crumb { display: none; }
.ws-crumb-sep { margin: 0 5px; opacity: .5; }
.ws-crumb-cur { color: var(--text); font-weight: 600; }
/* 큰 제목은 모바일에서도 감춘다(11-03) — 상단바 제목 + 대메뉴 소탭(.sub-tabs)이 이미 위치를 알려 줘 중복이다.
   제목만 있는 head() 조각은 모바일에선 통째로 비므로 자리도 없앤다. */
.ws-title { display: none; }
.ws--head { display: none; }
.ws-tabs {
    display: flex; gap: 2px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;                 /* 모바일: 탭 가로 스크롤 */
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.ws-tabs::-webkit-scrollbar { display: none; }
.ws-tab {
    flex: 0 0 auto;
    padding: 9px 14px;
    font-size: .9rem; font-weight: 500;
    color: var(--text-sub);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;              /* 컨테이너 보더 위에 탭 밑줄이 겹치게 */
    white-space: nowrap;
    transition: color .15s, border-color .15s;
}
.ws-tab:hover { color: var(--text); }
.ws-tab--on {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 700;
}

/* --- 탭바 (화면 내부 서브탭 — 유지) --- */
/* 11-03: 꽉 찬 파랑 → .seg 와 같은 '회색 트랙 + 떠오른 칸' 룩. 폭(칸마다 flex:1)은 그대로 */
.tab-bar {
    display: flex;
    gap: 2px;
    background: var(--seg-track);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 16px;
    /* 탭 글자는 꺾지 않는다(폰에서 '장사지역 공/유' 두 줄이 됐다) — 넘치면 가로 스크롤 */
    overflow-x: auto; scrollbar-width: none;
}
.tab-btn {
    flex: 1 1 0;
    min-width: max-content;     /* 기본은 같은 폭, 글자보다 좁아지진 않는다 */
    white-space: nowrap;
    border: none;
    background: none;
    padding: 7px 8px;
    border-radius: 7px;
    font-family: inherit;
    font-size: .84rem;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.tab-active {
    background: var(--seg-on);
    color: var(--text);
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(16,24,40,.1), 0 0 0 .5px rgba(16,24,40,.06);
}
.tab-content { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* --- 인포 카드 (출퇴근) --- */
.info-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.info-date { font-size: .9rem; color: var(--text-sub); margin-bottom: 2px; }
.info-time { font-size: 2.4rem; font-weight: 700; letter-spacing: -1px; margin-bottom: 14px; }
.info-row  { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--border); }
.info-label { font-size: .85rem; color: var(--text-sub); }
.info-value { font-size: .9rem; font-weight: 600; }

/* --- GPS 상태 --- */
.gps-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border: 1px solid var(--border);
    font-size: .85rem;
    color: var(--text-sub);
}
.gps-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--border);
    display: inline-block;
    transition: background .3s;
}
.gps-dot.active { background: var(--success); box-shadow: 0 0 6px var(--success); }
.btn-gps-reconnect {
    margin-left: auto;
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    font-size: .76rem;
    color: var(--text-sub);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.btn-gps-reconnect:hover { background: var(--bg); color: var(--text); }

/* --- 액션 카드 (큼직한 카드형 버튼) --- */
.action-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}
.action-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    text-align: center;
    color: var(--text);
}
.action-card:active { transform: scale(.96); box-shadow: none; }
.action-icon  { font-size: 32px; color: var(--primary); display: inline-flex; }
.action-icon svg { width: 1.5rem; height: 1.5rem; display: block; }
.action-label { font-size: .9rem; font-weight: 600; }
/* 아이콘 슬롯 SVG 공통 (라인 아이콘) */
.action-icon svg, .stat-icon svg, .gate-icon svg,
.member-card-avatar--default svg, .avatar-default-icon svg,
.vc-gallery-placeholder svg, .vc-card-thumb--empty svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.action-card--checkin  { border-color: var(--success); }
.action-card--report   { border-color: var(--primary); }
.action-card--map      { border-color: var(--warn); }
.action-card--checkout { border-color: var(--danger, #ff3b30); }

/* ===================================================
   대시보드 메뉴 (CEO·지부장·점장 홈) — 아이콘 왼쪽 + 라벨.
   모바일 = 리스트 행(아래 미디어쿼리), 태블릿/PC = 가로형 그리드 카드.
   base .action-card(세로형)는 출퇴근·보고 카드용이라 건드리지 않는다.
   =================================================== */
.menu-cat {
    font-size: .78rem; font-weight: 700; color: var(--text-sub);
    letter-spacing: .02em; margin: 22px 2px 8px;
}
.menu-cat:first-of-type { margin-top: 8px; }

.mobile-menu-grid .action-card {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 13px;
    padding: 15px 16px;
}
.mobile-menu-grid .action-label { flex: 1; font-weight: 600; }
.mobile-menu-grid .action-icon {
    width: 40px; height: 40px; border-radius: 11px; flex: none;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
}
.mobile-menu-grid .action-icon svg { width: 21px; height: 21px; }

/* PC(≥640): 메뉴는 4열(컬러 아이콘 카드). 일반 .action-grid(3열)보다 우선. */
@media (min-width: 640px) {
    .action-grid.mobile-menu-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 카테고리/기능별 아이콘 색 — 아래 순서상 .mobile-menu-grid .action-icon 뒤라 색이 우선 적용됨.
   틴트 칩 배경 + 같은 색 아이콘. red/blue 는 테마 토큰, 나머지는 다크 대비 위해 아래 보정. */
.action-icon.i-blue   { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.action-icon.i-green  { background: color-mix(in srgb, #1da03e 16%, transparent); color: #1da03e; }
.action-icon.i-amber  { background: color-mix(in srgb, #d97706 18%, transparent); color: #d97706; }
.action-icon.i-red    { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.action-icon.i-purple { background: color-mix(in srgb, #7c3aed 16%, transparent); color: #7c3aed; }
.action-icon.i-teal   { background: color-mix(in srgb, #0d9488 18%, transparent); color: #0d9488; }
.action-icon.i-slate  { background: color-mix(in srgb, var(--text-sub) 16%, transparent); color: var(--text-sub); }
.theme-dark .action-icon.i-green  { color: #34d399; }
.theme-dark .action-icon.i-amber  { color: #fbbf24; }
.theme-dark .action-icon.i-purple { color: #a78bfa; }
.theme-dark .action-icon.i-teal   { color: #2dd4bf; }

/* ===================================================
   대시보드 상단 KPI 스트립 — 오늘 매출(히어로) + 출근·미마감·재고부족·발주대기.
   PC: 한 줄(히어로 2 + 4). 모바일: 오늘 매출만(나머지 숨김).
   =================================================== */
.kpi-strip { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 12px; margin: 4px 0 8px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 16px; box-shadow: var(--shadow); }
.kpi-lab { font-size: .76rem; color: var(--text-sub); display: flex; align-items: center; gap: 7px; }
.kpi-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.kpi-val { font-size: 22.4px; font-weight: 800; letter-spacing: -.02em; margin-top: 7px;
    font-variant-numeric: tabular-nums; }
/* KPI 숫자 밑 작은 목록 (예: 재고 부족 → 부족 품목 몇 개) */
.kpi-sub { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.kpi-sub-item { font-size: .72rem; color: var(--text-sub); overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }
.kpi-sub-more { font-size: .7rem; color: var(--text-sub); opacity: .8; }
.kpi-hero { background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 9%, var(--surface)), var(--surface)); }
.kpi-hero .kpi-val { font-size: 27.2px; }
/* 오늘 매출 히어로 — 어제 대비 증감률 + 최근 7일 스파크라인 */
.kpi-delta { font-size: .74rem; font-weight: 600; margin-top: 3px; }
.kpi-delta.up   { color: #1da03e; }
.kpi-delta.down { color: var(--danger); }
.theme-dark .kpi-delta.up { color: #34d399; }
.kpi-spark { display: flex; align-items: flex-end; gap: 3px; height: 28px; margin-top: 8px; }
.kpi-spark > i { flex: 1; background: var(--primary); opacity: .7; border-radius: 2px 2px 0 0; min-height: 2px; }
.kpi-val.v-amber { color: #d97706; }
.kpi-val.v-red   { color: var(--danger); }
.kpi-val.v-blue  { color: var(--primary); }

/* ── 영업형 대시보드 위젯 (지부장 /manager · 대표 /dashboard 공용, 2026-09-14 홍보 이미지 구조) ── */
.kpi-strip--dash { grid-template-columns: repeat(4, 1fr); }
.kpi-strip--dash .kpi-delta { font-size: .74rem; font-weight: 600; margin-top: 3px; }
.kpi-strip--dash .kpi-delta.up   { color: #1da03e; }
.kpi-strip--dash .kpi-delta.down { color: var(--danger); }
.theme-dark .kpi-strip--dash .kpi-delta.up { color: #34d399; }
@media (max-width: 639.98px) {
    /* 폰: 2×2 — 아래쪽의 기존 모바일 규칙(.kpi-strip{1fr} / .kpi-min{display:none}, 메뉴 우선 시절)보다 특이도를 높여 이긴다 */
    .kpi-strip.kpi-strip--dash { grid-template-columns: 1fr 1fr; gap: 10px; }
    .kpi-strip--dash .kpi-min { display: block; }
    .kpi-strip--dash .kpi-hero .kpi-val { font-size: 21.6px; }
    .kpi-strip--dash .kpi-val { font-size: 20.8px; }
}
/* 소형 패널(.dx-*) — 대표 대시보드 로컬 스타일을 공통으로 올림. 모바일은 2열→1열(예전엔 메뉴 우선이라 숨겼음) */
.dx-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 8px; }
.dx-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 16px; box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
.dx-panel--full { margin: 4px 0 8px; }
.dx-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.dx-title { font-size: .9rem; font-weight: 700; padding-left: 8px; border-left: 3px solid var(--primary); }
.dx-sub { font-size: .7rem; color: var(--text-sub); text-decoration: none; }
.dx-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center;
    padding: 7px 2px; border-bottom: 1px solid var(--row-line); }
.dx-row:last-child { border-bottom: none; }
.dx-rank { font-size: .72rem; font-weight: 800; color: var(--text-sub); text-align: center; }
.dx-row:first-of-type .dx-rank { color: var(--warn); }
.dx-name { font-size: .84rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-track { display: block; height: 7px; border-radius: 4px; background: var(--row-line); overflow: hidden; margin-top: 4px; }
.dx-fill { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--primary-dk)); }
.dx-amt { text-align: right; white-space: nowrap; }
.dx-amt .a { font-size: .8rem; font-weight: 700; }
.dx-amt .m { display: block; font-size: .66rem; color: var(--text-sub); margin-top: 1px; }
.dx-empty { padding: 18px 0; text-align: center; color: var(--text-sub); font-size: .82rem; }
@media (max-width: 639.98px) { .dx-cols { grid-template-columns: 1fr; } }
/* 발주 현황 — 상태 타일 3개 + 최근 발주 행 */
.ord-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.ord-tile { border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.ord-tile-lab { font-size: .72rem; font-weight: 600; opacity: .85; }
.ord-tile-lab small { font-weight: 500; opacity: .8; }
.ord-tile-val { font-size: 1.15rem; font-weight: 800; }
.ord-tile--req  { background: color-mix(in srgb, var(--warn) 14%, transparent);    color: #b45309; }
.ord-tile--prog { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.ord-tile--done { background: color-mix(in srgb, var(--success) 14%, transparent); color: #15803d; }
.theme-dark .ord-tile--req  { color: #fbbf24; }
.theme-dark .ord-tile--done { color: #34d399; }
.dx-row--order { grid-template-columns: 40px 1fr auto; }
.ord-date { font-size: .74rem; color: var(--text-sub); font-variant-numeric: tabular-nums; }
/* 오늘 출근 현황 */
.attn-now { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.attn-now-val { font-size: 25.6px; font-weight: 800; color: var(--primary); }
.attn-now-sub { font-size: .82rem; color: var(--text-sub); }
.attn-bar { height: 8px; border-radius: 4px; background: var(--row-line); overflow: hidden; margin-top: 8px; }
.attn-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--primary-dk)); }
/* 재고 부족 칩 */
.low-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.low-chip { font-size: .76rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: rgba(255,59,48,.1); color: var(--danger); }
/* 재무 타일(대표) — 매입 / 순이익 / 수익률 */
.fin-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 8px; }
.fin-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; box-shadow: var(--shadow); }
.fin-ico { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; }
.fin-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fin-ico--blue  { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.fin-ico--green { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.fin-ico--amber { background: color-mix(in srgb, var(--warn) 18%, transparent);    color: #b45309; }
.fin-lab { font-size: .76rem; color: var(--text-sub); }
.fin-lab small { font-size: .66rem; }
.fin-val { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.theme-dark .kpi-val.v-amber { color: #fbbf24; }
@media (max-width: 639.98px) {
    .kpi-strip { grid-template-columns: 1fr; }
    .kpi-min { display: none; }   /* 모바일은 오늘 매출만 (메뉴가 빨리 오도록) */
    /* 3칸 재무 타일 — 천만 원대 금액이 "34,184,880 / 원"으로 꺾였다(11-03) */
    .fin-tile { padding-left: 6px; padding-right: 6px; }
    .fin-val { font-size: .84rem; }
}

/* --- 하단 고정 버튼 영역 --- */
.bottom-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-bottom: env(safe-area-inset-bottom, 16px);
}
.bottom-actions .btn-primary,
.bottom-actions .btn-secondary,
.bottom-actions .btn-warn { flex: 1; }

/* --- 모달 --- */
@keyframes modal-fade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop   { from { opacity: 0; transform: translateY(12px) scale(.97); }
                         to   { opacity: 1; transform: translateY(0) scale(1); } }
.modal-overlay {
    position: fixed; inset: 0;
    /* backdrop-filter(블러) 를 쓰지 않는다 — 화면 전체를 매 프레임 다시 합성해야 해서
       특히 PC 큰 화면·긴 목록 뒤에서 모달을 열 때 눈에 띄게 버벅였다.
       가리는 역할은 불투명도를 조금 올린 딤으로 대신한다. */
    background: rgba(15,18,28,.58);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    overscroll-behavior: contain;   /* 모달 안 스크롤이 뒤 페이지로 이어지지 않게 */

    /* 오버레이 자체는 애니메이션하지 않는다.
       뷰포트 전체 크기 요소의 opacity 를 애니메이션하면 매 프레임 화면 전체를 새 레이어로
       합성해야 해서, PC 큰 화면에서 모달 여는 순간 눈에 띄게 버벅였다.
       등장 연출은 .modal-box 의 modal-pop 만으로 충분하다.
       (exit 페이드는 예전에 안드로이드 WebView 리페인트 지연 버그로 이미 제거됨) */
}
/* 모달 열림 중 배경 스크롤 잠금 (main.js 가 토글) — 오버레이 아래 리페인트 차단 */
body.modal-open { overflow: hidden; }

.modal-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 400px;
    /* 화면보다 긴 모달(품목 등록 등)은 안에서 스크롤 — 없으면 낮은 노트북 화면에서 위아래가 잘려 저장 버튼을 못 눌렀다(10-02) */
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
    animation: modal-pop .22s cubic-bezier(.22,1,.36,1);
}
.modal-box h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions button { flex: 1; }

/* --- 모달 필드 (수정 모달 등) --- */
.modal-field { margin-bottom: 14px; }
.modal-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 6px;
}
.modal-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: .9rem;
    resize: none;
}
.modal-input:focus { outline: none; border-color: var(--primary); }
/* 모달 셀렉트 — 전역 select(높이 30px 고정)에 .modal-input 의 상하 9px 패딩이 겹치면 글자가 잘린다.
   오른쪽은 커스텀 화살표 자리(28px)를 남긴다 */
select.modal-input { height: 38px; padding: 0 28px 0 12px; }

/* --- 품목사진 --- */
/* 돋보기 — 품목명 옆 작은 버튼, 클릭 시 이미지 확대 모달(showImageModal). 사진 있는 품목에만 붙는다 */
.img-zoom-btn { display:inline-flex; align-items:center; justify-content:center;
    width:20px; height:20px; margin-left:4px; padding:0; border:none; background:none;
    color:var(--text-sub); cursor:zoom-in; vertical-align:-4px; }
.img-zoom-btn svg { width:14px; height:14px; }
.img-zoom-btn:hover { color:var(--primary); }
/* 품목 마스터 '사진' 열의 썸네일 — 없는 품목은 디폴트 자리표시(열 정렬 유지) */
.it-thumb { width:32px; height:32px; object-fit:cover; border-radius:6px;
    border:1px solid var(--border); vertical-align:middle; cursor:zoom-in; }
.it-thumb--empty { display:inline-flex; align-items:center; justify-content:center;
    background:var(--bg); color:var(--text-sub); cursor:default; }
.it-thumb--empty svg { width:15px; height:15px; }
/* 품목명 옆 인라인 썸네일 — 품목이 나오는 목록 화면 공용(업로드·편집은 품목 마스터에서만).
   사진 없는 품목은 자리표시로 이름 시작 위치를 맞춘다 */
.row-thumb { width:28px; height:28px; object-fit:cover; border-radius:6px;
    border:1px solid var(--border); vertical-align:middle; cursor:zoom-in; margin-right:7px; flex:none; }
.row-thumb--empty { display:inline-flex; align-items:center; justify-content:center;
    background:var(--bg); color:var(--text-sub); cursor:default; }
.row-thumb--empty svg { width:13px; height:13px; }

/* --- 아이템 리스트 --- */
.item-list { display: flex; flex-direction: column; gap: 10px; }
.item-row {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.item-row-name  { font-weight: 600; font-size: .95rem; }
.item-row-sub   { font-size: .8rem; color: var(--text-sub); margin-top: 2px; }

/* 표처럼 읽히는 리스트 — 낱장 카드가 10px 씩 떠 있으면 훑기 어렵다.
   .item-list 에 함께 주면 한 덩어리(테두리 하나 + 연한 행 구분선)로 보인다. */
.item-list--rows {
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    overflow: hidden;
}
.item-list--rows > .item-row {
    background: none; border: none; border-radius: 0;
    border-bottom: 1px solid var(--row-line);
    padding: 9px 14px;
}
.item-list--rows > .item-row:last-child { border-bottom: none; }
.item-list--rows > .item-row:hover { background: var(--bg); }
.item-list--rows > .empty-state { padding: 22px 0; font-size: .88rem; }

/* 행 한 줄 구성(이름·배지·아이디 등을 가로로) — 승인/발급 류 목록 공용 */
.item-row-main {
    flex: 1 1 auto; min-width: 0;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
/* 행 왼쪽 이니셜 아바타 — 사진 없는 목록에 얼굴 역할 */
.row-avatar {
    flex: 0 0 28px; width: 28px; height: 28px; margin-right: 10px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 700;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
}

/* --- 정산 상태 색상 --- */
.status-paid   { color: var(--success); font-weight: 700; }
.status-unpaid { color: var(--danger);  font-weight: 700; }

/* --- 차트 카드 --- */
.chart-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.chart-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: 12px; }

/* --- 코드 결과 카드 — 라벨·코드·복사를 한 줄로 --- */
.code-result-card {
    background: color-mix(in srgb, var(--primary) 5%, var(--surface));
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-top: 14px;
    border: 1.5px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.code-label { font-size: .8rem; color: var(--text-sub); flex: none; }
.code-value { font-size: 20px; font-weight: 700; letter-spacing: 2px; flex: 1 1 auto;
    font-family: 'Courier New', monospace; }

/* --- 스와이프 슬라이더 --- */
.swipe-hint { font-size: .8rem; color: var(--text-sub); text-align: center; margin-bottom: 8px; }
.slider-container {
    overflow-x: auto;
    display: flex;
    gap: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}
.slider-item {
    flex: 0 0 100%;
    scroll-snap-align: start;
}
.slider-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.slider-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.slider-dot.active { background: var(--primary); }

/* --- 비품 현황 고정 헤더 --- */
.sticky-header {
    position: sticky;
    top: var(--nav-h);
    background: var(--surface);
    z-index: 10;
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
}

/* --- 빈 상태 --- */
.empty-state { text-align: center; color: var(--text-sub); padding: 40px 0; font-size: .95rem; }

/* --- CEO 출퇴근 바 --- */
.ceo-attendance-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}
.btn-checkin-sm  { background: var(--success); color: #fff; border: none; border-radius: var(--radius-sm); padding: 8px 16px; font-weight: 700; cursor: pointer; }
.btn-checkout-sm { background: var(--danger);  color: #fff; border: none; border-radius: var(--radius-sm); padding: 8px 16px; font-weight: 700; cursor: pointer; }
.attend-status   { flex: 1; text-align: center; font-size: .9rem; color: var(--text-sub); }

/* --- 날짜 피커 --- */
.date-picker {
    width: auto;
    padding: 6px 10px;
    font-size: .85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
}

/* --- 반응형: 태블릿/PC --- */
@media (min-width: 640px) {
    .page-container { padding: 24px 40px; }
    .card-grid { grid-template-columns: 1fr 1fr; }
    .action-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1440px) {
    .page-container { padding: 28px 56px; }
}

/* ===================================================
   모바일 대시보드 메뉴 — 리스트 행 (옵션3)
   각 카테고리(.action-grid)가 하나의 둥근 리스트 카드가 되고, 그 안에서
   메뉴가 행으로 쌓인다(아이콘 + 라벨 + 오른쪽 화살표). 엄지로 누르기 쉬운 형태.
   =================================================== */
@media (max-width: 639.98px) {
    .action-grid.mobile-menu-grid {
        grid-template-columns: 1fr;
        gap: 0;
        margin-top: 12px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        overflow: hidden;
    }
    .mobile-menu-grid .action-card {
        background: transparent;
        border: none;
        border-bottom: 1px solid var(--row-line);
        border-radius: 0;
        box-shadow: none;
        padding: 10px 14px;   /* 컴팩트하게 (2026-09-02) — 글자크기는 유지, 높이·아이콘만 줄임 */
        gap: 11px;
    }
    .mobile-menu-grid .action-card:last-child { border-bottom: none; }
    .mobile-menu-grid .action-card:active { transform: none; background: rgba(0,0,0,.05); }
    .theme-dark .mobile-menu-grid .action-card:active { background: rgba(255,255,255,.06); }
    /* 오른쪽 화살표(클릭 가능 표시) — 마크업 수정 없이 CSS 로 */
    .mobile-menu-grid .action-card::after {
        content: '›';
        color: var(--text-sub);
        opacity: .55;
        font-size: 24px;
        line-height: 1;
        margin-left: 4px;
    }
    .mobile-menu-grid .action-icon { width: 31px; height: 31px; border-radius: 9px; }
    .mobile-menu-grid .action-icon svg { width: 17px; height: 17px; }
    .mobile-menu-grid .action-label { font-size: .92rem; }   /* 글자크기 유지 */
}

/* ── 슈퍼어드민 stat 카드 ── */
.stat-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
@media (min-width: 640px) {
    .stat-row { grid-template-columns: repeat(4, 1fr); }
}
.stat-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: border-color .15s;
}
.stat-card:hover { border-color: var(--text-sub); }
/* 색조는 그대로 두되 그라데이션은 걷어냄 — 같은 색의 단색 틴트 */
.stat-card--blue   { background: #eaf4fd; }
.stat-card--green  { background: #e9f9f0; }
.stat-card--teal   { background: #e5f5f2; }
.stat-card--orange { background: #fff5e6; }
.theme-dark .stat-card--blue   { background: #0c2a45; border-color: rgba(10,132,255,.2); }
.theme-dark .stat-card--green  { background: #0c3220; border-color: rgba(52,199,89,.2); }
.theme-dark .stat-card--teal   { background: #0c2e2a; border-color: rgba(100,210,200,.2); }
.theme-dark .stat-card--orange { background: #322200; border-color: rgba(255,159,10,.2); }
.stat-icon  { font-size: 28.8px; line-height: 1; display: inline-flex; align-items: center; }
.stat-icon svg { width: 1.7rem; height: 1.7rem; display: block; }
.stat-label { font-size: .75rem; color: var(--text-sub); font-weight: 500; margin-bottom: 2px; }
.stat-value { font-size: 20.8px; font-weight: 800; color: var(--text); letter-spacing: -.5px; }

/* ── 정보 그리드 ── */
.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 8px;
}
@media (min-width: 640px) {
    .info-grid { grid-template-columns: 1fr 1fr; }
}
.kv-list  { display: flex; flex-direction: column; gap: 0; }
.kv-row   { display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .85rem; }
.kv-row:last-child { border-bottom: none; }
.kv-key   { color: var(--text-sub); font-weight: 500; }
.kv-val   { font-weight: 600; color: var(--text);
            /* 값(금액)은 줄이지 않고 왼쪽 설명이 접힌다 — 폰에서 "1,458,540 / 원"으로 꺾였다(11-03). 긴 글은 70%에서 접힘 */
            flex-shrink: 0; max-width: 70%; text-align: right; }

/* ===================================================
   PC 레이아웃 — 상단 대메뉴 + 좌측 하위메뉴
   대메뉴(사이드바의 카테고리)를 상단바로 올리고, 고른 대메뉴의 하위 링크만 사이드바에 남긴다.
   =================================================== */
:root { --sidebar-w: 188px; --pc-topbar-h: 0px; --pc-sb-toggle-w: 40px; }
/* 사이드바 접기 — 폭 변수만 0으로 바꾸면 본문 padding·브랜드 폭이 전부 따라온다 */
body.sb-collapsed { --sidebar-w: 0px; }

.sidebar, .pc-topbar {
    /* 내비 전용 팔레트(라이트/다크 테마와 무관하게 항상 다크 네이비) — 초록→파랑 전환(2026-09-14) */
    --sb-bg-top: #14306e;
    --sb-bg-bot: #0b1f4f;
    --sb-card:   #112a62;
    --sb-text:   #e8eefc;
    --sb-muted:  #9db3e3;
    --sb-active: #3b82f6;
    --sb-line:   rgba(255,255,255,.08);
}
.sidebar, .pc-topbar { display: none; }

@media (min-width: 1024px) {
    :root { --pc-topbar-h: 46px; }
    body.has-sidebar { padding-left: var(--sidebar-w); padding-top: var(--pc-topbar-h); }
    /* 데스크톱: 사이드바가 있는 화면만 — 상단 대메뉴·사이드바가 로고·사용자·로그아웃·테마를 모두 제공하므로 상단바는 감춘다.
       (지도 화면만 예외 — 자체 컨트롤을 상단바에 둠) 콘텐츠-우선, 화면 간 일관.
       ※ has-sidebar 로 스코프 필수 — 슈퍼어드민 콘솔처럼 사이드바 없는 화면은 상단바가 유일한 내비게이션. */
    body.has-sidebar .top-nav:not(.top-nav--map) { display: none !important; }
    /* PC 는 상단바를 고정하지 않는다 — 사이드바가 늘 있고, 고정하면 세로 공간만 먹는다 */
    .top-nav { position: static; }
    /* 고정 상단 대메뉴가 생겼으므로 화면 안 sticky 요소는 그 아래에 붙는다 */
    .sticky-header { top: var(--pc-topbar-h); }

    /* PC: 사이드바가 대메뉴→메뉴→탭 3단을 다 보여주므로 본문 큰 제목·탭은 감추고
       작은 브레드크럼("창고 반출 › 반출 이력")만 남긴다. */
    .ws-title, .ws-tabs { display: none; }
    .ws--head { display: block; }
    .ws { margin-bottom: 12px; }
    .ws-crumb {
        display: block;
        font-size: .78rem;
        color: var(--text-sub);
        letter-spacing: -.01em;
    }

    /* ── 상단 대메뉴 ── */
    .pc-topbar {
        display: flex;
        align-items: stretch;
        position: fixed;
        top: 0; left: 0; right: 0;
        height: var(--pc-topbar-h);
        background: linear-gradient(90deg, var(--sb-bg-top), var(--sb-bg-bot));
        /* 모달(200)보다 아래 — 대메뉴가 모달 위로 뜨면 안 된다 */
        z-index: 150;
    }

    .sidebar {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: var(--pc-topbar-h); left: 0; bottom: 0;
        width: var(--sidebar-w);
        background: linear-gradient(180deg, var(--sb-bg-top), var(--sb-bg-bot));
        border-right: none;
        z-index: 200;
        overflow-y: auto;
    }
    body.sb-collapsed .sidebar { display: none; }
}

/* ── 상단 대메뉴 내부 ── */
/* 브랜드 + 접기버튼이 사이드바 폭을 정확히 채운다 → 대메뉴가 사이드바 열을 침범하지 않는다.
   (접으면 사이드바 폭이 0 이 되므로 브랜드는 제 크기로 돌아간다) */
.pc-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    width: calc(var(--sidebar-w) - var(--pc-sb-toggle-w));
    box-sizing: border-box;
    padding: 0 10px 0 16px;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -.4px;
    white-space: nowrap;
    overflow: hidden;
    color: #ffffff;
    text-decoration: none;
    flex-shrink: 0;
}
body.sb-collapsed .pc-brand { width: auto; padding-right: 14px; }
.pc-brand-img { width: 24px; height: 24px; object-fit: contain; border-radius: 6px; flex-shrink: 0; }
/* 사이드바 접기/펴기 — 사이드바 열의 오른쪽 끝에 붙어 경계 역할도 한다 */
.pc-sb-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--pc-sb-toggle-w);
    border: none;
    background: none;
    color: var(--sb-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: color .15s, background .15s;
}
.pc-sb-toggle:hover { background: rgba(255,255,255,.10); color: #ffffff; }
.pc-sb-toggle svg { width: 18px; height: 18px; display: block; }
/* min-width:0 이라야 오른쪽 공지 영역에 자리를 내주고 스스로 가로 스크롤된다 */
.pc-menu { display: flex; align-items: stretch; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.pc-menu::-webkit-scrollbar { height: 0; display: none; }
/* ── 우측 상단: 테마 · 공지(종+배지) · 프로필 메뉴 ── */
.pc-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; padding: 0 12px 0 8px; flex-shrink: 0; }
.pc-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border: none;
    border-radius: 9px;
    background: none;
    color: var(--sb-muted);
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.pc-icon-btn:hover { background: rgba(255,255,255,.10); color: #ffffff; }
.pc-icon-btn svg { width: 19px; height: 19px; display: block; }
/* 모바일 헤더 종 — 이름 왼쪽, 배지는 오른쪽 위 작은 동그라미 (10-04) */
.nav-right { display: flex; align-items: center; gap: 2px; margin-left: auto; position: relative; z-index: 1; }
.nav-bell { position: relative; }
/* 헤더 종은 모바일 전용 — PC 는 상단바 종이 있다. 지도 화면은 이 헤더가 PC 에도 보여 종이 두 개 겹쳤다(10-05) */
@media (min-width: 1024px) {
    .top-nav .nav-bell, .top-nav .nav-right { display: none !important; }   /* .nav-right 는 종·☰ 뿐(둘 다 PC 에선 숨김) */
}
.nav-bell .nav-badge {
    position: absolute; top: -3px; right: -7px; margin-left: 0;
    min-width: 15px; height: 15px; padding: 0 4px; font-size: .6rem;
    border: 2px solid var(--surface); box-sizing: content-box;
}
/* 알림함 — 종 아래 작은 드롭다운, 제목 한 줄씩 (공지 + 앱 알림, 10-05) */
.inbox-panel {
    position: fixed; z-index: 400; top: 56px; right: 8px; width: 272px; max-width: calc(100vw - 16px);
    display: flex; flex-direction: column; overflow: hidden; padding: 4px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 10px 28px rgba(16,24,40,.18);
}
.inbox-list { max-height: 300px; overflow-y: auto; overscroll-behavior: contain; }
.inbox-item { display: flex; align-items: center; gap: 7px; padding: 7px 8px; border-radius: 8px; font-size: .82rem; }
.inbox-item.is-link { cursor: pointer; }
.inbox-item.is-link:hover { background: var(--bg); }
.inbox-ico { flex: 0 0 auto; font-size: .62rem; font-weight: 700; padding: 2px 5px; border-radius: 5px; }
.inbox-ico--notice { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
.inbox-ico--alert  { color: #b45309; background: color-mix(in srgb, var(--warn, #f59e0b) 16%, transparent); }
.theme-dark .inbox-ico--alert { color: #fbbf24; }
.inbox-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-sub); }
.inbox-item.unread .inbox-title { color: var(--text); font-weight: 700; }
.inbox-item.unread .inbox-ico::after { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
    background: var(--danger); margin-left: 4px; vertical-align: 1px; }
.inbox-at { flex: 0 0 auto; font-size: .68rem; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.inbox-empty { padding: 16px 8px; text-align: center; color: var(--text-sub); font-size: .8rem; }
.inbox-all { display: block; margin-top: 2px; padding: 7px 8px; border-top: 1px solid var(--border);
    font-size: .74rem; color: var(--primary); text-decoration: none; text-align: right; }

/* 미확인 공지 수 — 종 오른쪽 위 작은 동그라미 */
.pc-notice .nav-badge {
    position: absolute;
    top: 1px; right: 1px;
    margin-left: 0;
    min-width: 15px; height: 15px;
    padding: 0 4px;
    font-size: .62rem;
    border: 2px solid var(--sb-bg-top);
    box-sizing: content-box;
}

.pc-profile { position: relative; margin-left: 4px; }
.pc-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    border: none;
    border-radius: 999px;
    background: none;
    color: var(--sb-text);
    cursor: pointer;
    transition: background .15s;
}
.pc-profile-btn:hover { background: rgba(255,255,255,.10); }
.pc-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    display: inline-flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.pc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pc-avatar svg  { width: 22px; height: 22px; color: var(--sb-text); }
.pc-profile-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.pc-profile-name { font-size: .8rem; font-weight: 700; color: #ffffff; white-space: nowrap; }
.pc-profile-role { font-size: .68rem; color: var(--sb-muted); white-space: nowrap; }

.pc-profile-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px); right: 0;
    min-width: 160px;
    padding: 6px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 10px 28px rgba(0,0,0,.18);
    /* 모달(200)보다는 아래, 본문 sticky(100)보다는 위 */
    z-index: 160;
}
.pc-profile-menu.open { display: block; }
.pc-profile-menu form { margin: 0; }
.pc-profile-item {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--text);
    font-size: .84rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.pc-profile-item:hover { background: var(--bg); }
.pc-profile-item--danger { color: var(--danger); }
.pc-menu-btn {
    padding: 0 15px;
    margin: 6px 0;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--sb-muted);
    font-size: .875rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.pc-menu-btn:hover { background: rgba(255,255,255,.08); color: #ffffff; }
/* 고른 대메뉴 = 테두리로 감싼 칩 (지금 어느 묶음을 보고 있는지 한눈에) */
.pc-menu-btn.on {
    color: #ffffff;
    background: rgba(255,255,255,.10);
    box-shadow: inset 0 0 0 1.5px var(--sb-active);
}

/* 사이드바 내부 — 다크 그린 (목업 기준) */
/* 고른 대메뉴 이름 — 사이드바가 무엇의 하위인지 알려준다 */
.sidebar-sect {
    padding: 16px 18px 10px;
    font-size: .95rem;
    font-weight: 700;
    color: #ffffff;
    border-bottom: 1px solid var(--sb-line);
    flex-shrink: 0;
}
.sidebar-nav {
    flex: 1;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border-radius: 12px;
    color: var(--sb-muted);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.sidebar-link:hover { background: rgba(255,255,255,.06); color: var(--sb-text); }
/* 활성 = 은은한 채움 + 좌측 강조 바 (글로우 없음) */
.sidebar-link.active {
    background: rgba(59,130,246,.18);
    color: #ffffff;
    box-shadow: inset 3px 0 0 var(--sb-active);
}
.sidebar-divider { height: 1px; background: var(--sb-line); margin: 10px 14px; }

/* 아이콘은 상단 대메뉴 + 하위메뉴 구조에선 소음이라 감춘다(스프라이트는 프로필 아바타 등이 계속 쓴다) */
.sidebar-link-icon { display: none; }

/* ── 3단째: 사이드바 하위 탭 (아코디언) ──
   메뉴마다 자기 하위 탭을 갖고, 화살표로 각자 펼치고 접는다(여러 개 동시에 열 수 있음). */
.sidebar-sub { display: none; }
.sidebar-sub.open { display: flex; }
.sidebar-sub {
    flex-direction: column;
    gap: 1px;
    /* 들여쓰기 + 세로 안내선으로 '이 메뉴의 하위'임을 보인다 */
    margin: 2px 0 6px 22px;
    padding-left: 10px;
    border-left: 1px solid var(--sb-line);
}
.sidebar-sub-link {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: .77rem;
    font-weight: 600;
    color: var(--sb-muted);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .15s, color .15s;
}
.sidebar-sub-link:hover { background: rgba(255,255,255,.06); color: #ffffff; }
.sidebar-sub-link.on { color: #ffffff; background: rgba(59,130,246,.18); }

/* 접기/펴기 화살표 — 링크 안 오른쪽 끝. 클릭은 이동과 분리된다(스크립트가 stopPropagation) */
.sidebar-caret {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: none;
    color: inherit;
    opacity: .55;
    cursor: pointer;
    transform: rotate(-90deg);
    transition: transform .18s ease, opacity .15s, background .15s;
}
.sidebar-caret:hover { opacity: 1; background: rgba(255,255,255,.1); }
.sidebar-caret.open { transform: rotate(0deg); }
.sidebar-caret svg { display: block; }
/* 카테고리 헤더는 상단 대메뉴로 올라갔다 — 사이드바에선 안 보인다 */
.sidebar-cat { display: none; }
/* 고르지 않은 대메뉴의 하위 링크 숨김 */
.cat-hidden { display: none !important; }

/* ★깜빡임 차단 — 어느 대메뉴를 열지 정해지기 전엔 아무것도 그리지 않는다.
   서버는 모든 메뉴를 펼친 채 내려주므로, 스크립트가 접기 전에 한 번 그려지면
   '전체 목록이 번쩍였다가 접히는' 깜빡임이 난다. 스크립트가 `menu-ready` 를 달면 그때 보인다. */
.sidebar-nav:not(.menu-ready) .sidebar-link,
.sidebar-nav:not(.menu-ready) .sidebar-sub { visibility: hidden; }

/* ── 스크롤바 숨김 (휠·드래그·터치로 스크롤) ── */
.sidebar-nav { scrollbar-width: none; -ms-overflow-style: none; }
.sidebar-nav::-webkit-scrollbar { width: 0; height: 0; display: none; }
/* 사이드바 맨 아래(좌측 하단) — 테마 토글. .sidebar 가 flex column 이라 margin-top:auto 로 바닥에 붙는다 (2026-09-14) */
.sidebar-foot {
    margin-top: auto;
    padding: 10px 12px;
    border-top: 1px solid var(--sb-line);
    display: flex; align-items: center;
    flex-shrink: 0;
}
.sidebar { scrollbar-width: none; }
.sidebar::-webkit-scrollbar { width: 0; display: none; }
.sidebar-nav.sb-dragging { cursor: grabbing; }
.sidebar-nav.sb-dragging .sidebar-link { cursor: grabbing; }

/* ===================================================
   토스트 (Android/PC 공통)
   =================================================== */
.nfp-toast-container {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    width: 90%;
    max-width: 360px;
}
.nfp-toast {
    background: rgba(29,29,31,.93);
    color: #f5f5f7;
    padding: 11px 22px;
    border-radius: 24px;
    font-size: .88rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,.28);
    animation: nfpToastIn .22s ease both;
    pointer-events: auto;
    text-align: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    max-width: 100%;
    word-break: keep-all;
}
.nfp-toast--success {
    background: rgba(52,199,89,.15);
    color: #30d158;
    border: 1px solid rgba(52,199,89,.3);
}
.nfp-toast--error {
    background: rgba(255,69,58,.15);
    color: #ff453a;
    border: 1px solid rgba(255,69,58,.3);
}
/* ── ⓘ 도움말 버튼 — 라벨 옆 긴 설명글 대신 붙인다. data-hint 전역 위임이 클릭 시 토스트로 띄움 ── */
.info-i {
    display: inline-flex; align-items: center; justify-content: center;
    width: 15px; height: 15px; margin-left: 5px; vertical-align: -2px;
    border: 1px solid var(--text-sub); border-radius: 50%;
    background: none; padding: 0; cursor: pointer;
    color: var(--text-sub); font-size: 10px; font-weight: 700; font-style: italic;
    font-family: Georgia, serif; line-height: 1;
}
.info-i:hover { color: var(--primary); border-color: var(--primary); }

/* 배경을 반투명 파랑으로 두면 파란 버튼 위에서 글자가 묻힌다 — 기본 토스트처럼 불투명 어두운 판 위에 밝은 파랑 글자 */
.nfp-toast--info {
    background: rgba(29,29,31,.96);
    color: #9ec7ff;
    border: 1px solid rgba(10,132,255,.45);
}
@keyframes nfpToastIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===================================================
   커스텀 Confirm / Prompt 다이얼로그
   =================================================== */
.nfp-dialog-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: nfpFadeIn .18s ease;
}
@keyframes nfpFadeIn { from { opacity: 0; } to { opacity: 1; } }
.nfp-dialog-box {
    background: var(--surface);
    border-radius: 20px;
    padding: 28px 24px 20px;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 12px 48px rgba(0,0,0,.35);
}
.nfp-dialog-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
    text-align: center;
}
.nfp-dialog-msg {
    font-size: .9rem;
    color: var(--text-sub);
    line-height: 1.55;
    margin-bottom: 20px;
    white-space: pre-line;
    text-align: center;
}
.nfp-dialog-input {
    width: 100%;
    margin-bottom: 16px;
    font-size: .95rem;
}
.nfp-dialog-actions {
    display: flex;
    gap: 10px;
}
.nfp-dialog-actions button { flex: 1; }

/* ─────────────────────────────────────────
 * 분류·상태 표기 규약 (2026-08-15 확정)
 *   분류(반복 속성: 식자재/비품, 로그 유형, 역할) = .cat — 배경 없는 색 텍스트
 *   상태(유효/사용됨, 입금 등)                 = .st  — 색점 + 텍스트
 *   칩(.badge)은 '조치가 필요한 강조'에만 남긴다 (미입금·반려·재고부족 등)
 * ───────────────────────────────────────── */
.cat { font-weight: 600; }
.cat--amber { color: #b45309; }
.theme-dark .cat--amber { color: #fbbf24; }
.cat--blue  { color: var(--primary); }
.cat--green { color: #1da03e; }
.theme-dark .cat--green { color: #34d399; }
.cat--gray  { color: var(--text-sub); }

.st { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.st::before { content: ''; width: 7px; height: 7px; border-radius: 50%; flex: none;
    background: var(--text-sub); }
.st--ok::before   { background: var(--success); }
.st--warn::before { background: var(--warn); }
.st--bad::before  { background: var(--danger); }
.st--info::before { background: var(--primary); }
/* 종결·중립 상태 — 글자도 점도 조용히 (색 = 조치 필요, 회색 = 끝난 일) */
.st--off { color: var(--text-sub); font-weight: 400; }
.st--off::before { background: color-mix(in srgb, var(--text-sub) 40%, transparent); }

/* ─────────────────────────────────────────
 * 배지 (role / status 표시)
 * ───────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .2px;
}
.badge-primary { background: rgba(0,113,227,.12); color: var(--primary); }
.badge-success { background: rgba(52,199,89,.15); color: var(--success); }
.badge-warn    { background: rgba(255,159,10,.15); color: var(--warn); }
.badge-info    { background: rgba(90,200,250,.15); color: #1398c7; }
.theme-dark .badge-info { color: #5ac8fa; }

/* ─────────────────────────────────────────
 * 필터 바
 * ───────────────────────────────────────── */
.filter-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text-sub);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.filter-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0,113,227,.08);
}

/* ─────────────────────────────────────────
 * 탭 배지 (숫자 알림)
 * ───────────────────────────────────────── */
.tab-badge {
    display: inline-block;
    background: var(--danger);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
    vertical-align: middle;
    line-height: 1.4;
    margin-left: 2px;
}


/* ═══════════════════════════════════════════
 * 모바일 상단 네비 회원명 (전역)
 * ═══════════════════════════════════════════ */
.mobile-nav-member-name {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    padding: 0 6px;
    white-space: nowrap;
    overflow: hidden;
    max-width: 80px;
    text-overflow: ellipsis;
}
@media (min-width: 1024px) {
    .mobile-nav-member-name { display: none; }
}

/* ═══════════════════════════════════════════
 * 회원 정보 빠른 모달 (전역 — sidebar fragment)
 * ═══════════════════════════════════════════ */
.mim-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0 0;
    gap: 4px;
}
.mim-avatar-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.mim-avatar-img {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
}
.mim-avatar-default {
    font-size: 80px;
    line-height: 1;
}
.mim-name {
    font-size: 20.8px;
    font-weight: 800;
    text-align: center;
    color: var(--text);
    margin-top: 6px;
}
.mim-logincode {
    font-size: .78rem;
    text-align: center;
    color: var(--text-sub);
    font-family: 'Courier New', monospace;
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 2px;
}
.mim-role {
    font-size: .88rem;
    text-align: center;
    color: var(--text-sub);
    margin-top: 4px;
}
.mim-phone {
    font-size: 1.05rem;
    text-align: center;
    color: var(--primary);
    font-weight: 600;
    margin: 8px 0 16px;
}

/* ── 비품 일별 요약 (Task 15) ── */
.supply-total-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: var(--surface);
    border-radius: 12px; font-weight: 700; font-size: .9rem;
    border: 1px solid var(--border); margin-bottom: 12px;
}
.supply-slide-row {
    display: flex; gap: 12px; overflow-x: auto;
    padding-bottom: 8px; -webkit-overflow-scrolling: touch;
}
.supply-truck-card {
    flex: 0 0 88%; max-width: 360px;
    border: 1px solid var(--border); border-radius: 12px;
    padding: 14px; background: var(--surface);
}
.supply-truck-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.supply-truck-num { font-weight: 700; font-size: .95rem; }
.supply-truck-total { font-size: .82rem; color: var(--primary); font-weight: 600; }
.supply-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
/* 품목명만 접히게 두고 머리글·숫자는 붙여 쓴다 — 폰 폭에서는 '수량' 이 '수/량' 으로 쪼개진다 */
.supply-table th { color: var(--text-sub); font-weight: 500; padding: 6px 4px; font-size: .78rem; white-space: nowrap; }
.supply-table td { padding: 7px 4px; border-top: 1px solid var(--border); }
.supply-table td:not(:first-child) { white-space: nowrap; }
@media (min-width: 1024px) {
    .supply-truck-card { flex: 0 0 320px; }
}

/* ===================================================
   사이드바 메뉴 배지 (공지 미확인 수)
   =================================================== */
.nav-badge {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* 공지 목록 미확인 점 */
.notice-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    display: inline-block;
}

/* ===================================================
   공지 인앱 배너 (상단, 확인 시까지 유지)
   =================================================== */
.nfp-notice-stack {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    /* 모달(200)·확인창보다 아래 — 위에 있으면 확인창 버튼을 가렸다(10-02 E2E). 상단바(100)보다는 위 */
    z-index: 150;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 92%;
    max-width: 460px;
    pointer-events: none;
}
.nfp-notice-item {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 24px rgba(0,0,0,.18);
    padding: 12px 12px 12px 14px;
    transition: opacity .22s, transform .22s;
    animation: nfpToastIn .22s ease both;
}
.nfp-notice-item-icon { color: var(--primary); flex-shrink: 0; margin-top: 1px; }
.nfp-notice-item-body { flex: 1; min-width: 0; cursor: pointer; }
.nfp-notice-item-title {
    font-size: .9rem; font-weight: 700; color: var(--text);
    margin-bottom: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nfp-notice-item-text {
    font-size: .82rem; color: var(--text-sub); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nfp-notice-item-close {
    flex-shrink: 0;
    background: none; border: none;
    color: var(--text-sub);
    font-size: 20.8px; line-height: 1;
    cursor: pointer; padding: 0 2px;
}
.nfp-notice-item-close:hover { color: var(--text); }

/* ===================================================
   모션 / 전환 (점진적 향상 — 미지원 브라우저는 전부 무시)
   =================================================== */

/* 페이지 전환(@view-transition)은 제거됨 — 안드로이드 WebView 에서 전환이 끝나지 않아
   옛 페이지 스냅샷이 화면에 고정되고 입력이 전부 먹히는 현상 발생. 재도입 시 실기기 검증 필수. */

/* ── 터치 피드백 ──
   button:active / .action-card:active 의 scale 은 이미 있음. 여기선 탭 지연만 제거. */
button, a, [role="button"], .action-card { touch-action: manipulation; }

/* ── 키보드 포커스 링 ──
   input 류는 이미 box-shadow 포커스 링이 있으므로 제외(이중 링 방지). */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible,
.action-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ── 모션 최소화 선호 ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ── 모바일: 중앙 다이얼로그 → 바텀시트 ──
   PC(≥1024px)는 기존 중앙 모달 유지. .nfp-dialog-* (confirm/prompt) 는 대상 아님. */
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ── 모바일 내비 (fragments/sidebar.html 이 그림) — 헤더 우측 ☰(대메뉴) + 헤더 바로 아래 하위메뉴 탭바.
   PC(≥1024)는 상단 대메뉴바·사이드바가 같은 역할을 하므로 전부 숨김. 메뉴 원천은 사이드바 마크업(.sidebar-cat) 하나라
   역할·권한별 항목이 자동으로 따라온다. (2026-09-14 홍보 이미지 좌측 화면 구조) ── */
.mnav-btn, .sub-tabs, .mnav-sheet, .mnav-backdrop { display: none; }

/* 헤더 우측 스코프 셀렉트(점장 선택·전체 차량 등) — 필요한 페이지가 헤더 액션 영역에 <select class="nav-scope"> 를 넣는다.
   네이티브 select 라 옵션이 많아도(대표: 전 지부) 트리거 폭은 안 커진다 — 라벨만 말줄임. 지도 헤더는 PC 에도 보여 공통 규칙. */
.nav-scope {
    max-width: 128px; height: 32px; padding: 0 26px 0 10px;
    border: 1px solid var(--border); border-radius: 9px;
    background: var(--surface); color: var(--text);
    font-size: .82rem; font-weight: 600; text-overflow: ellipsis;
}

@media (max-width: 1023.98px) {
    /* 헤더 우측 큰메뉴 버튼 */
    .mnav-btn {
        display: inline-flex; align-items: center; justify-content: center;
        width: 38px; height: 38px; flex-shrink: 0;
        border: none; border-radius: 10px; background: transparent; color: var(--text);
        cursor: pointer; -webkit-tap-highlight-color: transparent;
    }
    .mnav-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
    .mnav-btn:active { background: var(--bg); }
    /* 헤더에 스코프 셀렉트가 있으면 가운데 제목 폭을 줄여 겹치지 않게 */
    .top-nav:has(.nav-scope) .nav-title { max-width: 34%; }

    /* 하위메뉴 탭바 — 헤더 바로 다음 형제로 끼워 헤더 아래에 sticky */
    .sub-tabs {
        display: flex; gap: 2px;
        position: sticky; top: calc(var(--nav-h) + env(safe-area-inset-top, 0px)); z-index: 99;
        background: var(--surface); border-bottom: 1px solid var(--border);
        padding: 0 8px;
        overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .sub-tabs::-webkit-scrollbar { display: none; }
    .sub-tab {
        flex: 0 0 auto; min-width: 64px;
        display: flex; flex-direction: column; align-items: center; gap: 3px;
        padding: 8px 10px 7px;
        color: var(--text-sub); font-size: .72rem; font-weight: 600; white-space: nowrap; text-decoration: none;
        border-bottom: 2px solid transparent; margin-bottom: -1px;   /* 컨테이너 보더 위에 밑줄이 겹치게 */
        -webkit-tap-highlight-color: transparent;
    }
    .sub-tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
    .sub-tab.on { color: var(--primary); border-bottom-color: var(--primary); }
    /* 탭바가 있으면 화면 안 sticky 헤더는 그 아래에 붙고, 전체높이 컨테이너(지도)는 --subtabs-h 만큼 뺀다 */
    body.has-subtabs .sticky-header { top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + var(--subtabs-h, 0px)); }

    /* 대메뉴 시트 (☰) — 모달과 같은 바텀시트 결 */
    .mnav-backdrop { position: fixed; inset: 0; z-index: 210; background: rgba(0,0,0,.35); }
    .mnav-sheet {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 211;
        background: var(--surface); border-radius: 20px 20px 0 0;
        padding: 14px 14px calc(16px + env(safe-area-inset-bottom, 0px));
        box-shadow: var(--shadow-lg);
        animation: sheet-up .26s cubic-bezier(.22,1,.36,1);
    }
    body.mnav-open .mnav-backdrop, body.mnav-open .mnav-sheet { display: block; }
    .mnav-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 12px; font-weight: 700; }
    .mnav-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .mnav-cat {
        display: flex; flex-direction: column; align-items: center; gap: 4px;
        padding: 14px 6px 12px;
        border: 1px solid var(--border); border-radius: 14px; background: var(--bg); color: var(--text);
        font-size: .86rem; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent;
    }
    .mnav-cat small { font-size: .7rem; font-weight: 500; color: var(--text-sub); }
    .mnav-cat.on { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
    .mnav-sheet-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 14px; }
    .mnav-sheet-foot form { margin: 0; }
    /* 시트 하단 '개인정보 변경' — 옆의 로그아웃(.btn-logout)과 같은 크기·결 */
    .mnav-foot-link {
        display: inline-flex; align-items: center; justify-content: center;
        min-height: 34px; padding: 0 12px;
        border: 1px solid var(--border); border-radius: 9px;
        color: var(--text); font-size: .82rem; font-weight: 600; text-decoration: none;
    }

    /* 서브페이지 헤더 [뒤로] [제목] [☰] — 양쪽 폭이 달라도 제목이 정확히 화면 가운데 오게 절대배치 */
    .top-nav .nav-title {
        position: absolute; left: 50%;
        top: calc(env(safe-area-inset-top, 0px) + var(--nav-h) / 2);
        transform: translate(-50%, -50%);
        max-width: 56%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    /* 색상 팔레트(.cpal-box)도 모달과 같은 바텀시트로 — 모바일에서 팔레트가 짤리던 것 해결 (2026-08-25) */
    .modal-box, .cpal-box {
        /* 인라인 style="max-width:340px" 등 6곳을 덮어야 해서 !important 사용 */
        width: 100% !important;
        max-width: none !important;
        max-height: 88vh;
        overflow-y: auto;
        overscroll-behavior: contain;
        position: relative;
        border-radius: 20px 20px 0 0;
        padding-top: 28px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
        animation: sheet-up .26s cubic-bezier(.22,1,.36,1);
    }
    /* 그래버 핸들 */
    .modal-box::before {
        content: '';
        position: absolute;
        top: 10px; left: 50%;
        transform: translateX(-50%);
        width: 38px; height: 4px;
        border-radius: 999px;
        background: var(--border);
    }
}

/* ─────────────────────────────────────────────
   데이터 표 (웹 관리자 콘솔 공용) — .table-wrap > table.data-table
   라이트/다크 테마·모바일 대응. 각 페이지의 인라인 정의를 대체.
   ───────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    /* 엑셀형 밀도 — 13px + 좁은 셀. 모바일(639px↓)은 카드로 변환되므로 여긴 PC 전용 밀도다.
       tabular-nums: 숫자 폭을 고정해 금액 자릿수가 세로로 정렬된다(이게 없으면 표가 안 '읽힌다'). */
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
/* 숫자(금액·수량) 열 우측정렬 — 각 페이지가 인라인으로 반복하던 규칙을 공용화(2026-08-24) */
.data-table th.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table th,
.data-table td {
    padding: 4px 10px;
    border-bottom: 1px solid var(--row-line);
    vertical-align: middle;
    text-align: left;
}
.data-table thead th {
    background: var(--bg);
    font-weight: 600;
    font-size: .72rem;
    color: var(--text-sub);
    white-space: nowrap;
    padding-top: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.data-table tbody tr:last-child td { border-bottom: none; }
/* 줄무늬 — 행이 촘촘해지면 시선이 줄을 잃는다. 구획·소계·펼침 행은 자기 배경이 있으니 제외.
   :where() 로 특이도를 0으로 눌러, 아래 hover·구획 규칙이 그대로 이긴다. */
.data-table tbody tr:nth-child(even):where(:not(.tbl-group-head, .grp-row, .tbl-subtotal, .is-expanded)) td {
    background: color-mix(in srgb, var(--text) 3%, transparent);
}
.data-table tbody tr:hover td { background: var(--bg); }
/* 지출·차감 등 음수 금액 — 합계만 진하게, 차감액은 한 톤 눌러서 스캔을 돕는다 */
.data-table td.neg { color: var(--text-sub); }

/* ── 구획 행 · 소계 · 펼침 행 ──
   데이터 행과 같은 톤이면 그룹 머리가 그냥 한 줄로 읽힌다(재고 현황의 품목 그룹이 그랬다).
   그룹은 파란 띠 + 왼쪽 강조선, 소계는 회색 띠로 역할을 나눈다. hover 규칙보다 뒤에 둬야 안 눌린다. */
.data-table tr.tbl-group-head > td,
.data-table tr.grp-row > td {
    background: color-mix(in srgb, var(--primary) 8%, var(--bg));
    color: var(--text);
    font-weight: 700; font-size: .82rem; letter-spacing: .02em;
    border-bottom: 1px solid var(--border);
    box-shadow: inset 3px 0 0 var(--primary);
}
/* 그룹에 속한 데이터 행은 한 단 들여써서 소속을 보인다 */
.data-table tr.grp-item > td:first-child { padding-left: 26px; }
.data-table tr.tbl-subtotal > td {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
/* 펼친 행 = 아래 상세의 머리. 왼쪽 강조선으로 상세와 한 덩어리로 묶는다. */
.data-table tr.is-expanded > td {
    background: color-mix(in srgb, var(--primary) 6%, var(--bg));
    border-bottom-color: transparent;
}
.data-table tr.is-expanded > td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
/* 표 안 폼 컨트롤 통일 */
.data-table input,
.data-table select {
    /* 표 안 입력칸 — 행 높이를 키우지 않으면서 셀을 꽉 채우는 값. 더 줄이면 셀 안에서 떠 보인다. */
    padding: 3px 7px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: .82rem;
    max-width: 100%;
}
.data-table input[type=number] { width: 92px; text-align: right; }

@media (max-width: 639.98px) {
    .data-table th,
    .data-table td { padding: 9px 10px; font-size: .84rem; }

    /* ── 옵트아웃: .tbl-flat(표) + .table-wrap--flat(래퍼) ──
       모바일에서도 카드로 바꾸지 않고 진짜 표로 남는다(넘치는 열은 래퍼가 가로 스크롤).
       재고 현황처럼 "품목·구분·수량 한 줄"이 카드보다 훨씬 잘 읽히는 표에 쓴다. */
    .table-wrap--flat { overflow-x: auto; }
    .tbl-flat th, .tbl-flat td { padding: 7px 8px; white-space: nowrap; }

    /* 표 → 카드 (sales-view.css 의 표→카드 패턴과 동일) — 정산류 등 데이터 표 공통 모바일 대응 */
    .table-wrap:not(.table-wrap--flat) { border: none; background: none; box-shadow: none; }
    /* 줄무늬·hover 배경은 표 전용 — 카드에선 짝수 카드가 통째로 틴트돼 안쪽 보더가 묻힌다 (2026-08-22) */
    .data-table:not(.tbl-flat) tbody tr:nth-child(even):where(:not(.tbl-group-head, .grp-row, .tbl-subtotal, .is-expanded)) td,
    .data-table:not(.tbl-flat) tbody tr:hover td { background: none; }
    .data-table:not(.tbl-flat), .data-table:not(.tbl-flat) tbody { display: block; width: 100%; }
    .data-table:not(.tbl-flat) thead { display: none; }
    .data-table:not(.tbl-flat) tr {
        display: block;
        background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 4px 14px 6px; margin-bottom: 8px;
    }
    .data-table:not(.tbl-flat) tr:last-child { margin-bottom: 0; }
    /* 카드 안에서도 표처럼 — 간격은 좁히고 항목 사이는 연한 헤어라인으로 나눈다 */
    .data-table:not(.tbl-flat) td {
        display: flex; justify-content: space-between; align-items: center; gap: 12px;
        border: none; border-bottom: 1px solid var(--row-line);
        padding: 7px 0; white-space: normal; text-align: right;
    }
    .data-table:not(.tbl-flat) tr > td:last-child { border-bottom: none; }
    /* 들여쓰기는 표에서만 의미가 있다 — 카드에서는 라벨이 왼쪽 끝에 붙어야 한다 */
    .data-table:not(.tbl-flat) tr.grp-item > td:first-child { padding-left: 0; }
    /* 라벨은 왼쪽에 고정(auto 마진), 값은 오른쪽에 모인다.
       space-between 만 쓰면 값이 여러 조각(숫자+단위, 이름+배지)일 때 조각들이 양끝으로 흩어진다. */
    .data-table:not(.tbl-flat) td::before {
        content: attr(data-label);
        color: var(--text-sub); font-weight: 600; font-size: .76rem;
        flex-shrink: 0; text-align: left; margin-right: auto;
    }
    .data-table:not(.tbl-flat) td:empty::before,
    .data-table:not(.tbl-flat) td[colspan]::before { content: none; }
    .data-table:not(.tbl-flat) td[colspan] { display: block; text-align: center; }

    /* 그룹(지사·품목그룹) 헤더 — 카드가 아니라 카드들 위에 얹히는 구획 라벨 */
    .data-table:not(.tbl-flat) tr.tbl-group-head,
    .data-table:not(.tbl-flat) tr.grp-row {
        background: none; border: none; box-shadow: none;
        padding: 16px 2px 6px; margin: 0;
    }
    .data-table:not(.tbl-flat) tr.tbl-group-head > td,
    .data-table:not(.tbl-flat) tr.grp-row > td {
        background: none !important; box-shadow: none; border: none;
        border-left: 3px solid var(--primary);
        text-align: left; font-size: .84rem; font-weight: 800;
        color: var(--text); letter-spacing: .02em; padding: 1px 0 1px 9px;
    }
    /* 펼친 카드 — 강조선은 카드 왼쪽 전체에 (표에서 쓰던 첫 칸 inset 은 카드에선 어색하다) */
    .data-table:not(.tbl-flat) tr.is-expanded {
        background: color-mix(in srgb, var(--primary) 5%, var(--surface));
        border-left: 3px solid var(--primary); padding-left: 11px;
    }
    .data-table:not(.tbl-flat) tr.is-expanded > td {
        background: none; box-shadow: none; border-bottom-color: var(--row-line);
    }
    .data-table:not(.tbl-flat) tr.is-expanded > td:last-child { border-bottom: none; }

    /* 소계 — 카드 아래 붙는 한 줄 요약(라벨 좌 / 금액 우) */
    .data-table:not(.tbl-flat) tr.tbl-subtotal {
        background: none; border: none; box-shadow: none;
        display: flex; justify-content: space-between; align-items: baseline;
        gap: 12px; padding: 8px 4px 2px; margin: 0 0 4px;
    }
    .data-table:not(.tbl-flat) tr.tbl-subtotal > td {
        display: block; padding: 0; text-align: right;
        background: none; border: none;
    }
    /* 소계 줄은 왼쪽 라벨(colspan 칸)이 이미 '○○ 소계'라 data-label 을 또 붙이면 '소계750,000 원'이 된다 */
    .data-table:not(.tbl-flat) tr.tbl-subtotal > td::before { content: none; }
    .data-table:not(.tbl-flat) tr.tbl-subtotal td[colspan] {
        text-align: left; font-size: .78rem; color: var(--text-sub);
    }

    /* 카드 첫 줄(대상 이름)은 라벨 없이 카드 제목처럼 */
    .data-table:not(.tbl-flat) td.tbl-row-head {
        display: block; text-align: left;
        font-size: .95rem; font-weight: 700; color: var(--text);
        padding: 0 0 8px; margin-bottom: 6px;
        border-bottom: 1px solid var(--border);
    }
    .data-table:not(.tbl-flat) td.tbl-row-head::before { content: none; }

    /* 카드 마지막 줄(합계)은 구분선 위에 강조 */
    .data-table:not(.tbl-flat) td.tbl-row-total {
        margin-top: 6px; padding-top: 8px;
        border-top: 1px solid var(--border); font-weight: 700;
    }
}

/* ─────────────────────────────────────────────
   KPI 요약 타일 (웹 콘솔 공용) — 매출 조회 화면과 동일 룩
   ───────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.kpi-grid.kpi-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-grid.kpi-2 { grid-template-columns: repeat(2, 1fr); }
.kpi-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 14px 16px;
}
.kpi-card--accent { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.kpi-label { font-size: .76rem; color: var(--text-sub); font-weight: 600; }
.kpi-value {
    font-size: 23.2px; font-weight: 700; color: var(--text);
    margin-top: 6px; line-height: 1.15; letter-spacing: -.02em;
}
.kpi-value .unit { font-size: .9rem; font-weight: 600; color: var(--text-sub); margin-left: 2px; }
.kpi-value.pos { color: var(--success); }
.kpi-value.neg { color: var(--danger); }

/* 월 이동 툴바 (여러 콘솔 페이지 공용) */
.month-nav { display: flex; align-items: center; gap: 10px; margin: 1rem 0; flex-wrap: wrap; }

/* 내역 화면 공통 대상 필터 (전체/지사/점장) */
.staff-filter { margin: 0 0 1rem; }
.staff-filter-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.staff-filter-label { font-size: .82rem; font-weight: 600; color: var(--text-sub); }
/* 컴팩트 셀렉트 — 내용 폭에 맞추되 상·하한만. PC에서 좌우로 늘어지지 않게 */
.staff-filter-form select { width: auto; min-width: 120px; max-width: 200px; }
.staff-filter-hint { font-size: .82rem; color: var(--text-sub); }
/* 모듈 셀렉터(owner-branch-filter) — staff-filter 와 동일한 컴팩트 룩 */
.obf-label { font-size: .82rem; font-weight: 600; color: var(--text-sub); margin-right: 2px; }
.obf-sel   { width: auto; min-width: 120px; max-width: 200px; margin-right: 10px; }

@media (max-width: 639.98px) {
    .kpi-grid, .kpi-grid.kpi-3, .kpi-grid.kpi-2 { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .kpi-value { font-size: 19.2px; }
    .kpi-card { padding: 12px 13px; }
}

/* ── 표 페이지네이션 (data-paginate, main.js가 자동 생성) ── */
.tbl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.tbl-toolbar-left { display: flex; align-items: center; gap: 10px; }
.tbl-count { font-size: .8rem; color: var(--text-sub); font-weight: 500; white-space: nowrap; }
.tbl-count strong { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; margin: 0 1px; }
.tbl-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.tbl-pagination button {
    min-width: 30px; height: 30px;
    padding: 0 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-sub);
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.tbl-pagination button:hover:not(:disabled):not(.active) { background: var(--surface); border-color: var(--border); color: var(--text); }
.tbl-pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tbl-pagination button:disabled { opacity: .35; cursor: default; }

/* ── 컴팩트 툴바 부품 (11-03) — 목록 위 필터줄을 낮고 촘촘하게.
   .seg  : 세그먼트(역할·기간 같은 배타 선택). 회색 트랙 위에 고른 칸만 떠오른다. 숫자는 .seg-n
   .ctl-select : 내용 폭 셀렉트(전역 select 의 width:100% 를 끊는다)
   .ctl-search : 돋보기 아이콘이 안에 들어간 검색칸
   .ctl-check  : '퇴사자 포함' 같은 보조 스위치 라벨 */
:root       { --seg-track: #eceef2; --seg-on: #ffffff; }
.theme-dark { --seg-track: #2c2c2e; --seg-on: #4a4a4d; }
.seg {
    display: inline-flex; align-items: center; gap: 2px; flex: none;
    padding: 3px; border-radius: 10px;
    background: var(--seg-track);
    max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg-btn {
    display: inline-flex; align-items: center; gap: 6px; flex: none;
    height: 28px; padding: 0 11px;
    border: none; border-radius: 7px; background: transparent;
    color: var(--text-sub); font-family: inherit; font-size: .8rem; font-weight: 600;
    white-space: nowrap; cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
    background: var(--seg-on); color: var(--text);
    box-shadow: 0 1px 2px rgba(16,24,40,.1), 0 0 0 .5px rgba(16,24,40,.06);
}
.seg-n {
    min-width: 18px; height: 17px; padding: 0 5px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .68rem; font-weight: 700; font-variant-numeric: tabular-nums;
    background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text-sub);
}
.seg-btn.active .seg-n { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }

select.ctl-select, .tbl-pagesize {
    width: auto; flex: none; max-width: 220px;
    height: 32px; font-size: .8rem; padding: 0 28px 0 10px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background-color: var(--surface); color: var(--text);
    background-position: right 8px center; background-size: 12px;
}
.ctl-search { position: relative; flex: 1; min-width: 160px; max-width: 280px; }
.ctl-search svg {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    width: 15px; height: 15px; pointer-events: none;
    fill: none; stroke: var(--text-sub); stroke-width: 2.2; stroke-linecap: round;
}
.ctl-search input {
    width: 100%; height: 32px; padding: 0 10px 0 32px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
    font-family: inherit; font-size: .82rem; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.ctl-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.ctl-check {
    display: inline-flex; align-items: center; gap: 7px; flex: none;
    height: 32px; font-size: .8rem; font-weight: 500; color: var(--text-sub);
    white-space: nowrap; cursor: pointer; user-select: none;
}
.tbl-ellipsis { padding: 0 4px; color: var(--text-sub); }

/* ── 모바일에서 감추는 것 ──
   엑셀 다운로드는 파일을 받아 표 도구로 여는 작업이라 폰에서는 쓸 자리가 없다.
   .hide-mobile 은 버튼(onclick)용, a[href*="/excel"] 은 링크형 내려받기를 자동으로 덮는다. */
@media (max-width: 639.98px) {
    .hide-mobile,
    a[href*="/excel"] { display: none !important; }
}

/* 수량 칸: 숫자와 단위(26 + 개)는 한 덩어리 —
   카드 모드에서 td 가 flex(space-between) 라 그냥 두면 둘이 양끝으로 갈라진다. */
@media (max-width: 639.98px) {
    /* td 의 flex gap(12px) 이 숫자와 단위 사이에도 들어가 '1,240   개' 로 벌어진다 →
       라벨은 ::before 의 auto 마진이 밀어내므로 gap 은 0 이어도 된다 */
    .data-table td.qty-cell { gap: 0; }
}

/* PC 에선 오른쪽 아래 구석에 — 위쪽에 있으면 탭·'추가' 버튼을 덮었다(10-02 E2E) */
@media (min-width: 900px) {
    .nfp-notice-stack { left: auto; right: 16px; transform: none; width: 360px; top: auto; bottom: 16px; flex-direction: column-reverse; }
}
