/* ─────────────────────────────────────────────────────────────
   한마음화물 산재보험 — 화면 틀 + 공통 컴포넌트
   디자인: 그리풀 Mall Manager(NEWSMP 셸 · shell.css / mall-admin.css)와 같다
   글꼴 Paperlogy(Regular 한 굵기, 서버에 둔 파일), 아이콘은 인라인 SVG(lucide)
   ───────────────────────────────────────────────────────────── */
@font-face{font-family:'Paperlogy';src:url('fonts/Paperlogy-Regular.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap}
:root {
  --brand: #036EB7;
  --brand-dark: #02588F;
  --brand-soft: #E6F1FA;
  --rail: #1B2227;
  --rail-fg: #96A2AB;
  --bg: #F5F6F7;
  --surface: #FFFFFF;
  --line: #E4E7EA;
  --line-soft: #EEF1F2;
  --text: #16191D;
  --text-2: #41505B;
  --muted: #6B7680;
  --muted-2: #8A929A;
  --danger: #C0452F;
  --warn: #B4791C;
  --ok: #1F7A4D;
  --radius: 12px;
  --font: 'Paperlogy', -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); }
body { font-family: var(--font); font-size: 13.5px; color: var(--text); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
input, button, select, textarea { font-family: inherit; font-size: inherit; }
.icon { flex: none; vertical-align: middle; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #CFD5DA; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
[hidden] { display: none !important; }

/* ── 틀: 상단바 / 메인메뉴(아이콘 레일) / 본문 ── */
.lms-app { min-width: 1024px; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.lms-top { flex: none; height: 56px; display: flex; align-items: center; gap: 18px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 30; }
.lms-brand { display: flex; align-items: center; gap: 10px; flex: none; color: var(--text); }
.lms-brand:hover { color: var(--text); }
.lms-logo { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.lms-brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.lms-brand-sub { font-size: 12px; color: var(--muted-2); padding-left: 10px; border-left: 1px solid var(--line); }

.lms-top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lms-ext { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-dark); font-size: 12.5px; white-space: nowrap; }
.lms-ext:hover { background: #D6E8F6; color: var(--brand-dark); }
.lms-user { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; }
.lms-avatar { width: 28px; height: 28px; border-radius: 50%; background: #DCE3E7; color: #41505B; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.lms-user-txt { line-height: 1.25; display: flex; flex-direction: column; }
.lms-user-txt b { font-size: 12.5px; font-weight: 600; }
.lms-user-txt small { font-size: 11px; color: var(--muted-2); }
.lms-logout { border: 0; background: none; cursor: pointer; padding: 0; color: #8A929A; display: flex; }
.lms-logout:hover { color: var(--danger); }

.lms-body { flex: 1; display: flex; min-height: 0; }

.lms-rail { flex: none; width: 84px; background: var(--rail); display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 2px; overflow-y: auto; }
.lms-rail-item { width: 72px; color: var(--rail-fg); border-radius: 10px; padding: 9px 2px 7px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.lms-rail-item span { font-size: 11px; font-weight: 600; letter-spacing: -0.03em; text-align: center; line-height: 1.2; word-break: keep-all; }
.lms-rail-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.lms-rail-item.is-on { background: var(--brand); color: #fff; }

.lms-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.lms-content { flex: 1; overflow: auto; padding: 22px 24px 40px; }
.lms-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.lms-crumb { font-size: 12px; color: var(--muted-2); margin-bottom: 5px; }
.lms-title { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.03em; }
.lms-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── 공통 컴포넌트 ── */
.btn { height: 34px; padding: 0 14px; border: 1px solid #DDE2E5; background: #fff; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: #B9C2C8; color: var(--text-2); }
.btn-primary { border-color: var(--brand); background: var(--brand); color: #fff; }
.btn-primary:hover { background: #025E9E; border-color: #025E9E; color: #fff; }
.btn-danger { border-color: var(--danger); background: var(--danger); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-ghost-danger:hover { border-color: #F0C4BB; background: #FDF2F0; color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card + .card { margin-top: 14px; }
.card-pad { padding: 18px 20px; }
.card-title { font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.grid-kpi { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 14px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; }
.kpi-label { font-size: 12.5px; color: var(--muted); }
.kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.3; }
.kpi-sub { font-size: 11.5px; color: var(--muted-2); }

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.pill { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 6px; background: #F1F3F4; color: var(--muted); white-space: nowrap; }
.pill-brand { background: var(--brand-soft); color: var(--brand); }
.pill-warn { background: #FBF2E2; color: var(--warn); }

.toolbar { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.toolbar .spacer { margin-left: auto; }
.input, .select { height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; outline: none; background: #fff; color: var(--text); }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input:disabled { background: #F5F6F7; color: var(--muted-2); }
.select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%238A929A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>') no-repeat right 10px center; }
.search { position: relative; display: inline-flex; align-items: center; }
.search .icon { position: absolute; left: 11px; color: #9AA3AB; pointer-events: none; }
.search .input { padding-left: 34px; width: 220px; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: #F1F3F4; }
.seg > button { padding: 5px 12px; border: 0; background: none; cursor: pointer; border-radius: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.seg > button:hover { color: var(--text); }
.seg > button.is-on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.status { font-size: 12.5px; color: var(--muted); }
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { height: 42px; padding: 0 12px; background: #FAFBFB; border-bottom: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); text-align: left; white-space: nowrap; }
.table td { height: 48px; padding: 6px 12px; border-bottom: 1px solid #F3F5F6; color: var(--text-2); vertical-align: middle; }
.table tbody tr:hover td { background: #FAFBFB; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .ctr { text-align: center; }
.table tfoot td { background: #FAFBFB; border-top: 1px solid var(--line); border-bottom: 0; color: var(--text); }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; font-size: 12.5px; color: var(--muted); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted-2); }

/* 입력 표 — 칸 안이 입력창 */
.table.edit { table-layout: fixed; }
.table.edit td { height: 46px; padding: 6px 8px; }
.table.edit th { padding: 0 8px; }
.table.edit .input { width: 100%; height: 32px; padding: 0 10px; }
.table.edit .input.num { text-align: right; font-variant-numeric: tabular-nums; }
.table.edit td.num { padding-right: 12px; }

/* 레이어(이름 → 사업자번호 고르기) */
.picker { position: absolute; z-index: 1000; background: #fff; border: 1px solid var(--line); border-radius: 12px; min-width: 220px; box-shadow: 0 12px 32px rgba(16,24,32,.12); padding: 6px; }
.picker h4 { margin: 4px 8px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.picker button { display: block; width: 100%; text-align: left; padding: 8px 10px; background: #fff; border: 0; border-radius: 8px; cursor: pointer; color: var(--text); font-variant-numeric: tabular-nums; }
.picker button:hover { background: #F1F5F9; }
.picker button.manual { color: var(--muted); border-top: 1px solid var(--line-soft); border-radius: 0 0 8px 8px; }

/* 안내 */
.guide { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.guide ol, .guide ul { margin: 0; padding-left: 18px; color: var(--text-2); line-height: 1.75; }
.guide b { color: var(--text); }
.calc { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 12px; border-radius: 8px; background: #F7F8F9; border: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; line-height: 1.6; }

/* 미리보기 — 가로 스크롤 */
.scroll-x { overflow-x: auto; }
.table.preview { width: max(1100px, 100%); white-space: nowrap; font-size: 12.5px; }
.table.preview th, .table.preview td { height: 38px; padding: 0 8px; text-align: center; border-right: 1px solid #F3F5F6; }
.table.preview td.on { color: var(--brand); }

/* ── 로그인 ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, #DCEBF7 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #E3EEF5 0%, transparent 55%), var(--bg); }
.login-card { width: min(760px, 100%); display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px rgba(16,24,32,.10); }
.login-side { position: relative; padding: 32px 28px; background: var(--rail); color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; overflow: hidden; }
.login-side::after { content: ''; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--brand); opacity: .35; }
.login-side .lms-logo { width: 44px; height: 44px; border-radius: 12px; }
.login-side h1 { margin: 16px 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.login-side p { margin: 0; color: var(--rail-fg); font-size: 13px; line-height: 1.6; }
.login-side small { position: relative; z-index: 1; color: var(--rail-fg); font-size: 11.5px; }
.login-form { padding: 36px 32px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.login-form h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.login-form .muted { margin: -8px 0 6px; font-size: 12.5px; }
.login-pw { position: relative; display: flex; align-items: center; }
.login-pw .icon { position: absolute; left: 14px; color: #9AA3AB; pointer-events: none; }
.login-pw .input { width: 100%; height: 46px; padding-left: 42px; font-size: 15px; border-radius: 10px; }
.login-form .btn { height: 46px; font-size: 14px; border-radius: 10px; }
.login-err { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 8px; background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C; font-size: 12.5px; }

/* ── 좁은 화면: 레일이 상단바 아래 가로줄로 ── */
@media (max-width: 1023px) {
  .lms-app { min-width: 0; height: auto; min-height: 100vh; overflow: visible; }
  .lms-top { position: sticky; top: 0; gap: 10px; padding: 0 12px; }
  .lms-brand-sub, .lms-user-txt, .lms-ext span { display: none; }
  .lms-body { flex-direction: column; }
  .lms-rail { width: 100%; flex-direction: row; justify-content: flex-start; padding: 6px 8px; gap: 4px; overflow-x: auto; position: sticky; top: 56px; z-index: 20; }
  .lms-rail-item { width: auto; flex-direction: row; gap: 6px; padding: 7px 12px; }
  .lms-content { padding: 16px 12px 32px; overflow: visible; }
  .lms-pagehead { flex-wrap: wrap; gap: 10px; }
  .lms-title { font-size: 19px; }
  .card { overflow-x: auto; }
  .search .input { width: 100%; }
  .guide { grid-template-columns: minmax(0, 1fr); }
  .table.edit { min-width: 860px; }
}
@media (max-width: 640px) {
  .login-card { grid-template-columns: 1fr; }
  .login-side { padding: 24px; gap: 16px; }
  .login-side small { display: none; }
  .login-form { padding: 28px 24px; }
}

/* 굵은 글씨 최소화(그리풀 weight-lite 와 같음) — 굵게 남기는 곳: 화면 제목 · 숫자 카드 · 로그인 제목 */
body * { font-weight: 400 !important; }
.lms-title, .kpi-value, .login-side h1, .login-form h2 { font-weight: 700 !important; }
