:root {
    --bg: #f1f5f9; --panel: #fff; --text: #0f172a; --muted: #64748b; --line: #e2e8f0; --line2: #cbd5e1;
    --dark: #1e293b; --primary: #2563eb; --green: #16a34a; --orange: #ea580c; --red: #dc2626; --amber: #d97706;
    --primary-soft: #dbeafe; --green-soft: #dcfce7; --red-soft: #fee2e2; --amber-soft: #fef3c7;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Malgun Gothic", "맑은 고딕", sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }
a { color: var(--primary); text-decoration: none; }
.muted { color: var(--muted); }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* ---------- 사무 화면 레이아웃 ---------- */
.app { display: flex; min-height: 100vh; }
.side { width: 210px; background: var(--dark); color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.brand { display: block; padding: 18px 18px 14px; color: #fff; font-size: 19px; }
.side nav { flex: 1; overflow-y: auto; padding-bottom: 10px; }
.side nav a { display: block; padding: 8px 18px; color: #cbd5e1; font-size: 14px; }
.side nav a:hover { background: #334155; color: #fff; }
.side nav a.on { background: var(--primary); color: #fff; }
.side nav a.field-link { color: #fbbf24; font-weight: bold; }
.side .grp { padding: 14px 18px 4px; font-size: 12px; color: #94a3b8; letter-spacing: .05em; }
.side .me { padding: 12px 18px; border-top: 1px solid #334155; font-size: 13px; }
.side .me .muted { color: #94a3b8; }
button.link { background: none; border: 0; color: #93c5fd; padding: 4px 0 0; cursor: pointer; font: inherit; }
.main { flex: 1; padding: 22px 28px 40px; min-width: 0; }
.page-title { margin: 0 0 16px; font-size: 22px; }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }

/* ---------- 공통 요소 ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.alert.ok { background: var(--green-soft); color: #14532d; }
.alert.err { background: var(--red-soft); color: #7f1d1d; }
.alert.big { font-size: 20px; padding: 16px 20px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border: 1px solid transparent;
       border-radius: 6px; background: var(--primary); color: #fff; font: inherit; font-weight: bold; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { filter: brightness(1.08); }
.btn.green { background: var(--green); } .btn.orange { background: var(--orange); } .btn.red { background: var(--red); }
.btn.gray { background: #64748b; }
.btn.light { background: #fff; color: var(--text); border-color: var(--line2); font-weight: normal; }
.btn.sm { padding: 4px 10px; font-size: 13px; }

label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.f.req > span::after { content: " *"; color: var(--red); }
input, select, textarea { font: inherit; color: var(--text); padding: 7px 9px; border: 1px solid var(--line2); border-radius: 6px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input[readonly] { background: #f1f5f9; }
input[type=checkbox] { width: 18px; height: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.field-validation-error, .validation-summary-errors { color: var(--red); font-size: 13px; }
.validation-summary-errors ul { margin: 0 0 10px; padding-left: 18px; }

table.grid { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
table.grid th { background: #f8fafc; color: #334155; font-weight: bold; text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--line2); white-space: nowrap; position: sticky; top: 0; }
table.grid td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr[data-href] { cursor: pointer; }
table.grid tr[data-href] td:has(> input[type=checkbox]:first-child) { cursor: default; min-width: 56px; }      /* 체크 칸: 눌러도 상세로 안 감 */
table.grid tbody tr:hover { background: #f8fafc; }
table.grid tfoot td { font-weight: bold; background: #f8fafc; border-top: 2px solid var(--line2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: bold; background: #e2e8f0; color: #334155; white-space: nowrap; }
.badge.blue { background: var(--primary-soft); color: #1e40af; } .badge.green { background: var(--green-soft); color: #166534; }
.badge.red { background: var(--red-soft); color: #991b1b; } .badge.amber { background: var(--amber-soft); color: #92400e; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.kpi .k { font-size: 13px; color: var(--muted); }
.kpi .v { font-size: 28px; font-weight: bold; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.bar { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--primary); }
.bar.warn > i { background: var(--red); }

/* 로그인 */
.login { width: 380px; max-width: 100%; background: #fff; border-radius: 10px; border: 1px solid var(--line); padding: 28px; }
.login h1 { margin: 0 0 4px; font-size: 22px; }
.login .muted { margin: 0 0 20px; }
.login label.f { margin-bottom: 12px; }
.login .btn { width: 100%; padding: 12px; font-size: 16px; }
.login .alt { margin-top: 16px; text-align: center; }
/* 로그인: PC(넓은 화면)에서는 왼쪽 회사 이름, 오른쪽 로그인 상자 */
.login-wrap .brand { display: none; }
@media (min-width: 1000px) {
    .login-wrap { position: fixed; inset: 0; display: grid; grid-template-columns: 1fr 1fr; align-items: center; justify-items: center; background: linear-gradient(120deg, #1e3a8a 0 46%, #f1f5f9 46%); }
    .login-wrap .brand { display: block; color: #fff; padding-right: 60px; }
    .login-wrap .brand h1 { margin: 0; font-size: 46px; } .login-wrap .brand p { margin: 10px 0 0; font-size: 18px; color: #c7d2fe; }
    .login-wrap .login { width: 420px; padding: 34px 30px; border: 0; box-shadow: 0 10px 30px rgba(15,23,42,.15); }
}

/* ---------- 현장(키오스크) 화면 ---------- */
body.field { font-size: 20px; background: #e2e8f0; font-family: "Malgun Gothic", "맑은 고딕", "Nirmala UI", "Iskoola Pota", sans-serif; }
.fbar { display: flex; align-items: center; gap: 16px; background: var(--dark); color: #fff; padding: 10px 18px; position: sticky; top: 0; z-index: 5; }
.fhome { color: #fbbf24; font-size: 22px; font-weight: bold; padding: 8px 14px; border: 2px solid #475569; border-radius: 8px; }
.ftitle { flex: 1; font-size: 26px; font-weight: bold; }
.fright { display: flex; align-items: center; gap: 16px; }
.fright form { margin: 0; }
#clock { font-size: 22px; font-weight: bold; font-variant-numeric: tabular-nums; }
.fuser { color: #cbd5e1; }
.fmain { padding: 18px 18px 120px; max-width: 1400px; margin: 0 auto; }
.fbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 22px; border: 0; border-radius: 10px;
        background: var(--primary); color: #fff; font: inherit; font-size: 22px; font-weight: bold; cursor: pointer; min-height: 64px; }
.fbtn.green { background: var(--green); } .fbtn.orange { background: var(--orange); } .fbtn.gray { background: #64748b; font-size: 18px; min-height: 48px; padding: 8px 16px; }
.fbtn.red { background: var(--red); } .fbtn.light { background: #fff; color: var(--text); border: 2px solid var(--line2); }
.fbtn.xl { font-size: 28px; min-height: 90px; padding: 18px 32px; }
.fbtn:active { transform: scale(.98); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.tile { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; min-height: 200px; border-radius: 16px;
        color: #fff; font-size: 30px; font-weight: bold; text-align: center; }
.tile small { font-size: 17px; font-weight: normal; opacity: .9; }
.tile .ico { font-size: 54px; line-height: 1; }
.tile.t1 { background: #2563eb; } .tile.t2 { background: #16a34a; } .tile.t3 { background: #0891b2; }
.tile.t4 { background: #ea580c; } .tile.t5 { background: #7c3aed; } .tile.t6 { background: #475569; }

.fpanel { background: #fff; border-radius: 14px; padding: 20px 22px; margin-bottom: 16px; }
.fpanel h2 { margin: 0 0 14px; font-size: 24px; }
.frow { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 12px; margin-bottom: 12px; }
.frow > span { font-weight: bold; text-align: right; }
.frow.req > span::after { content: " *"; color: var(--red); }
body.field input, body.field select, body.field textarea { font-size: 24px; padding: 12px 14px; border-width: 2px; border-radius: 10px; width: 100%; }
.fsearch { display: flex; gap: 12px; margin-bottom: 14px; }
.fsearch input { flex: 1; }

.flist { display: grid; gap: 10px; }
.fitem { display: flex; align-items: center; gap: 16px; background: #fff; border: 2px solid var(--line2); border-radius: 12px; padding: 14px 18px; color: var(--text); cursor: pointer; text-align: left; font: inherit; width: 100%; }
.fitem:hover, .fitem.on { border-color: var(--primary); background: #eff6ff; }
.fitem .main-t { font-size: 24px; font-weight: bold; }
.fitem .sub-t { font-size: 17px; color: var(--muted); }
.fitem .grow { flex: 1; }
.fitem .qty { font-size: 22px; font-weight: bold; text-align: right; white-space: nowrap; }

.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choices input { display: none; }
.choices label { padding: 14px 22px; border: 2px solid var(--line2); border-radius: 10px; background: #fff; cursor: pointer; font-size: 21px; min-width: 110px; text-align: center; }
.choices input:checked + label { background: var(--primary); color: #fff; border-color: var(--primary); }

.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.numpad button { font: inherit; font-size: 32px; font-weight: bold; min-height: 76px; border-radius: 10px; border: 2px solid var(--line2); background: #fff; cursor: pointer; }
.numpad button:active { background: var(--primary-soft); }
.numpad button.fn { background: #e2e8f0; font-size: 24px; }
.qty-grid { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
.qty-box { display: grid; gap: 12px; }
.qty-box label { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 10px; font-weight: bold; }
.qty-box input { font-size: 34px !important; text-align: right; font-weight: bold; }
.qty-box input:focus { background: #eff6ff; }
.factions { display: flex; gap: 14px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.pin-users { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.pin-dots { font-size: 44px; letter-spacing: 16px; text-align: center; min-height: 60px; }

@media (max-width: 900px) {
    .qty-grid { grid-template-columns: 1fr; }
    .frow { grid-template-columns: 1fr; }
    .frow > span { text-align: left; }
}

/* ---------- 인쇄 (거래명세서, 라벨) ---------- */
/* 인쇄할 때도 화면과 같은 바탕색(표 머리 회색 등)이 찍히게 */
html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
@media print {
    .side, .toolbar, .no-print, .fbar, .mtop, .navback { display: none !important; }
    .main { padding: 0; }
    body { background: #fff; }
    .card { border: 0; padding: 0; }
}

/* ---------- 핸디 스캐너 (작은 화면) ---------- */
body.scan { font-size: 17px; background: #f1f5f9; }
.sbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--dark); color: #fff; padding: 10px 12px; position: sticky; top: 0; z-index: 5; }
.sbar a { color: #fbbf24; font-weight: bold; }
.sbar span { color: #cbd5e1; font-size: 14px; }
.smain { padding: 10px; }
.smenu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.smenu a { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 110px; border-radius: 12px; color: #fff; font-size: 20px; font-weight: bold; text-align: center; }
.smenu a small { font-size: 13px; font-weight: normal; opacity: .9; }
.smenu .t2 { background: #16a34a; } .smenu .t3 { background: #0891b2; } .smenu .t4 { background: #ea580c; } .smenu .t5 { background: #7c3aed; }
.shead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.sinput { width: 100%; font-size: 22px; padding: 12px; border: 3px solid var(--primary); border-radius: 10px; }
.smsg { min-height: 26px; margin: 6px 0; font-weight: bold; }
.smsg.ok { color: var(--green); } .smsg.err { color: var(--red); }
.slist { display: grid; gap: 8px; }
.sitem { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line2); border-radius: 10px; padding: 10px; color: var(--text); }
.sitem b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sitem .muted { font-size: 13px; }
a.sitem { justify-content: space-between; font-size: 19px; padding: 16px 12px; }
.sqty { width: 80px; font-size: 20px; text-align: right; padding: 6px; }
.sbtn { width: 100%; padding: 14px; font-size: 20px; margin-top: 12px; }
.sbtn:disabled { background: #94a3b8; }
/* ---------- 공정 체크 / 진행 표시 ---------- */
.route { display: flex; flex-wrap: wrap; gap: 8px; }
.route-item { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line2); border-radius: 8px; background: #fff; cursor: pointer; font-weight: bold; }
.route-item.done { background: var(--green-soft); border-color: #86efac; color: #166534; }
.steps { display: flex; flex-wrap: wrap; gap: 8px; }
.step { flex: 1; min-width: 120px; padding: 12px 10px; border-radius: 10px; background: #e2e8f0; color: #64748b; text-align: center; }
.step b { display: block; font-size: 22px; }
.step small { font-size: 14px; }
.step.done { background: var(--green-soft); color: #166534; }
.step.now { background: var(--primary); color: #fff; }
.bigchk { display: inline-flex; cursor: pointer; }
.bigchk input { display: none; }
.bigchk span { width: 44px; height: 44px; border: 3px solid var(--line2); border-radius: 8px; background: #fff; display: inline-block; position: relative; }
.bigchk input:checked + span { background: var(--primary); border-color: var(--primary); }
.bigchk input:checked + span::after { content: "✔"; color: #fff; font-size: 28px; position: absolute; left: 7px; top: -2px; }
.kanban { display: flex; gap: 10px; overflow-x: auto; align-items: flex-start; padding-bottom: 10px; }
.kcol { min-width: 190px; flex: 1; background: #e2e8f0; border-radius: 8px; padding: 8px; }
.khead { font-weight: bold; padding: 4px 4px 8px; display: flex; justify-content: space-between; align-items: baseline; }
.khead span { font-weight: normal; font-size: 12px; color: var(--muted); }
.kcard { display: block; background: #fff; border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; color: var(--text); font-size: 13px; border-left: 4px solid var(--primary); }
.kcard b { font-size: 14px; }
.kcard .kq { font-weight: bold; margin-top: 2px; }
.kcard.late { border-left-color: var(--red); }
/* 등록된 품목 선택 / 새 품목 바로 입력 */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line2); border-radius: 8px; background: #fff; cursor: pointer; font-weight: bold; }
.seg label .muted { font-weight: normal; font-size: 13px; }
.newitem { background: #f0fdf4; border: 1px solid #86efac; border-radius: 8px; padding: 12px 14px; }
/* 검색되는 선택 상자 */
.combo { position: relative; }
.combo input { width: 100%; }
.combo-list { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 20; max-height: 320px; overflow-y: auto;
              background: #fff; border: 1px solid var(--primary); border-radius: 0 0 6px 6px; box-shadow: 0 8px 20px rgba(15,23,42,.18); }
.combo-item { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--line); color: var(--text); font-size: 14px; }
.combo-item:hover, .combo-item.on { background: var(--primary-soft); }
.combo-empty { padding: 10px; color: var(--muted); }
/* 키오스크: 오른쪽 아래 고정 버튼 (처음 / 뒤로 / 언어) */
.fdock { position: fixed; right: 14px; bottom: 14px; z-index: 30; display: flex; gap: 10px; }
.fbtn.dock { background: var(--dark); min-height: 72px; min-width: 130px; font-size: 24px; box-shadow: 0 6px 16px rgba(15,23,42,.35); border: 2px solid #475569; }
.fbtn.dock.lang { background: #7c3aed; border-color: #a78bfa; font-family: "Nirmala UI", "Iskoola Pota", "Malgun Gothic", sans-serif; }
html.tr-pending body { visibility: hidden; }
/* 현장 공정 진행 화면: 스크롤 없이 한 화면에 (완료 버튼은 위쪽) */
.compact .fpanel { padding: 12px 18px; margin-bottom: 10px; }
.compact .fpanel h2 { font-size: 20px; margin-bottom: 8px; }
.compact .qty-grid { grid-template-columns: 1fr 330px; gap: 10px; }
.compact .numpad { gap: 8px; }
.compact .numpad button { min-height: 52px; font-size: 26px; }
.factions.top { justify-content: stretch; margin: 0 0 10px; flex-wrap: nowrap; }
.factions.top .fbtn { flex: 1; min-height: 74px; font-size: 24px; padding: 10px 14px; }
.dq { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.dq label { display: grid; grid-template-columns: 105px 1fr; align-items: center; gap: 8px; font-weight: bold; font-size: 17px; }
.dq input { font-size: 26px !important; text-align: right; font-weight: bold; min-height: 52px; padding: 4px 10px; width: 100%; }
.dq input:focus { background: #eff6ff; }

/* 바코드를 출력한 작업지시 */
table.grid tbody tr.printed { background: #dcfce7; }
table.grid tbody tr.reprint, table.grid tbody tr.reprint:nth-child(even) { background: #ffe4e6; }      /* 재입고된 수동부스: 바코드 다시 뽑기 */
table.grid tbody tr.reprint:hover { background: #fecdd3; }
table.grid tbody tr.printed:hover { background: #bbf7d0; }

/* 거래처 탭 (사무실 화면 맨 위) */
.custbar { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--line2); }
.custbar a { padding: 7px 16px; border-radius: 8px 8px 0 0; background: #e2e8f0; color: #334155; font-weight: bold; font-size: 14px; }
.custbar a:hover { background: #cbd5e1; }
.custbar a.on { background: var(--primary); color: #fff; }

/* 사진 칸: Ctrl+V 로 붙여넣을 칸 표시 */
[data-paste] { cursor: copy; }
[data-paste].paste-on { outline: 3px solid var(--primary); outline-offset: 1px; }

/* ---------- 보기 편하게 (2026-10 개편): 큰 글씨 · 큰 버튼 · 진한 글자 · 넉넉한 칸 ----------
   60대 이상도 읽고 누르기 쉽게. 위쪽의 기본 규칙을 덮어씀 (휴대폰 규칙은 이 아래에 있어서 그대로 우선) */
:root { --bg: #eef2f6; --text: #0b1220; --muted: #475569; --line: #d5dde7; --line2: #9fb0c3; --dark: #172033; --primary: #1d4ed8; --primary-soft: #dbe7ff; }
body { font-size: 17px; line-height: 1.5; }
.side { width: 250px; }
.brand { font-size: 22px; padding: 20px 20px 14px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 11px 18px; font-size: 16.5px; color: #e2e8f0; border-left: 5px solid transparent; }
.side nav a i { font-style: normal; width: 24px; text-align: center; flex: none; font-size: 17px; }
.side nav a:hover { background: #2a3650; }
.side nav a.on { background: #1d4ed8; color: #fff; font-weight: bold; border-left-color: #fbbf24; }
.side .grp { padding: 18px 18px 6px; font-size: 14px; color: #fbbf24; font-weight: bold; letter-spacing: 0; }
.side details.more { margin-top: 10px; border-top: 1px solid #2f3b55; }
.side details.more summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 18px; color: #cbd5e1; font-size: 16px; }
.side details.more summary::-webkit-details-marker { display: none; }
.side details.more summary::after { content: "▼"; margin-left: auto; font-size: 12px; }
.side details.more[open] summary::after { content: "▲"; }
.side details.more summary i { font-style: normal; width: 24px; text-align: center; }
.side details.more a { padding: 9px 18px 9px 52px; font-size: 15.5px; }
.side details.more .sub { padding: 10px 18px 2px 52px; font-size: 13px; color: #94a3b8; }
.side .me { font-size: 15px; padding: 12px 18px 16px; }
.fsbox { padding: 10px 14px; border-top: 1px solid #2f3b55; color: #cbd5e1; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fsbox span { width: 100%; }
.fsbox button { flex: 1; white-space: nowrap; background: #2a3650; color: #fff; border: 1px solid #44516b; border-radius: 6px; padding: 6px 4px; cursor: pointer; font-family: inherit; line-height: 1.1; }
.fsbox button.on { background: #fbbf24; color: #111827; border-color: #fbbf24; font-weight: bold; }
html.fs-1 .main { zoom: 1.15; }
html.fs-2 .main { zoom: 1.3; }
.main { padding: 22px 30px 50px; }
.page-title { font-size: 27px; margin: 0 0 18px; }
.card { border-radius: 12px; padding: 18px 22px; border-color: var(--line); box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.card h2 { font-size: 19px; margin-bottom: 14px; }
.alert { font-size: 17px; padding: 14px 18px; border-radius: 10px; font-weight: bold; }
.alert.ok { border: 2px solid #86efac; } .alert.err { border: 2px solid #fca5a5; }
.btn { min-height: 44px; padding: 10px 18px; border-radius: 8px; font-size: 16px; }
.btn.sm { min-height: 34px; padding: 5px 12px; font-size: 14.5px; }
.btn.light { border-width: 2px; color: #1e293b; }
label.f { font-size: 15px; color: #1e293b; font-weight: bold; gap: 6px; }
label.f input, label.f select, label.f textarea { font-weight: normal; }
input, select, textarea { min-height: 44px; padding: 9px 12px; border: 2px solid var(--line2); border-radius: 8px; font-size: 16.5px; }
textarea { min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 3px solid #93c5fd; border-color: var(--primary); }
/* 체크 칸은 어디서나 크게 (화면마다 붙은 width:auto 같은 작은 크기보다 우선) */
input[type=checkbox], input[type=radio] { width: 24px !important; height: 24px !important; min-width: 24px; min-height: 0 !important; padding: 0; margin: 0 4px 0 0; flex: none; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
.form-grid { gap: 16px 20px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.form-actions { gap: 10px; margin-top: 20px; }
.toolbar { gap: 10px; margin-bottom: 16px; }
table.grid { font-size: 15.5px; }
table.grid th { font-size: 15px; padding: 11px 12px; background: #e8eef6; color: #0f172a; border-bottom: 2px solid var(--line2); }
table.grid td { padding: 10px 12px; }
table.grid th, table.grid td { word-break: keep-all; }   /* 한글 낱말이 중간에서 끊겨 세로로 쌓이지 않게 */
body { word-break: keep-all; }
table.grid tbody tr:nth-child(even) { background: #f8fafc; }
table.grid tbody tr:hover { background: #e0ecff; }
table.grid tbody tr.printed { background: #dcfce7; }
.table-wrap { border-radius: 10px; }
.badge { font-size: 14px; padding: 3px 10px; }
.kpi { border-radius: 12px; padding: 16px 18px; }
.kpi .k { font-size: 15px; color: #334155; font-weight: bold; }
.kpi .v { font-size: 32px; }
.kpi .s { font-size: 14px; }
.custbar { gap: 8px; }
.custbar a { padding: 10px 20px; font-size: 16px; }
.combo-item { font-size: 16px; padding: 10px 12px; }
.seg label { padding: 10px 16px; font-size: 16px; }
.route-item { padding: 10px 16px; font-size: 16px; }
.empty { font-size: 17px; }
/* 체크하면 할 수 있는 일이 나타나는 줄 (작업 현황 · 바코드 출력 · 입고 예정) */
.selbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; padding: 10px 14px; border-radius: 10px; background: #fff; border: 2px dashed var(--line2); min-height: 62px; }
.selbar .selon { display: none; }
.selbar .selhint { color: var(--muted); }
.selbar.has-sel { border: 2px solid var(--primary); background: #eff6ff; position: sticky; top: 0; z-index: 6; box-shadow: 0 4px 12px rgba(15,23,42,.12); }
.selbar.has-sel .selon { display: inline-flex; }
.selbar.has-sel .selhint { display: none; }
.btngroup { display: inline-flex; align-items: stretch; border: 2px solid var(--line2); border-radius: 8px; background: #fff; overflow: hidden; }
.btngroup > span { display: flex; align-items: center; padding: 0 12px; font-weight: bold; font-size: 15px; color: #334155; background: #f1f5f9; }
.btngroup .btn { border-radius: 0; border: 0; border-left: 1px solid var(--line2); min-height: 42px; }
.btngroup select { border: 0; border-radius: 0; min-height: 42px; }
/* 처음 화면: 큰 버튼 */
@media (max-width: 1150px) { .home-tiles { grid-template-columns: repeat(2, 1fr); } }
.home-hello { font-size: 20px; margin: 0 0 14px; color: #334155; }
.home-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.home-tile { display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; border-radius: 16px; color: #fff; min-height: 130px; box-shadow: 0 2px 6px rgba(15,23,42,.15); position: relative; }
.home-tile:hover { filter: brightness(1.08); transform: translateY(-1px); }
.home-tile .ico { font-size: 38px; line-height: 1; }
.home-tile b { font-size: 25px; }
.home-tile small { font-size: 16px; opacity: .95; }
.home-tile .cnt { position: absolute; top: 16px; right: 18px; background: #fff; color: #0f172a; font-weight: bold; font-size: 20px; border-radius: 99px; padding: 2px 14px; }
.home-tile.c1 { background: #1d4ed8; } .home-tile.c2 { background: #0e7490; } .home-tile.c3 { background: #15803d; }
.home-tile.c4 { background: #c2410c; } .home-tile.c5 { background: #6d28d9; } .home-tile.c6 { background: #475569; }

/* ---------- 휴대폰(좁은 화면)에서 사무실 화면 쓰기: 맨 아래에 두어 위의 규칙들보다 우선하게 함 ---------- */
.mtop, .navback, .m-only, .side nav a.m-only, .side .m-only { display: none; }
@media (max-width: 900px) {
    /* 휴대폰: 왼쪽 메뉴는 숨겨 두었다가 오른쪽 위 ☰ 를 누르면 오른쪽에서 나옴 */
    .app { display: block; }
    .mtop { display: flex; position: sticky; top: 0; z-index: 40; background: #1e3a8a; color: #fff; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; min-height: 50px; }
    .mtop b { flex: 1; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mtop a { color: #c7d2fe; font-size: 14px; white-space: nowrap; }
    .navbtn { background: transparent; border: 0; color: #fff; font-size: 30px; line-height: 1; padding: 4px 10px; cursor: pointer; }
    .side { display: none; position: fixed; top: 0; right: 0; width: min(84vw, 330px); height: 100%; z-index: 60; }
    body.nav-open .side { display: flex; box-shadow: -6px 0 24px rgba(0,0,0,.35); }
    body.nav-open .navback { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; }
    .side nav a { padding: 12px 18px; font-size: 16px; }
    .side .grp { font-size: 13px; padding-top: 16px; }
    .m-only, .side nav a.m-only, .side .m-only { display: block; } .pc-only { display: none !important; }
    .side { width: min(86vw, 330px); }
    html.fs-1 .main, html.fs-2 .main { zoom: 1; }
    .home-tiles { grid-template-columns: 1fr 1fr !important; gap: 10px; }
    .home-tile { min-height: 120px; padding: 14px; } .home-tile b { font-size: 19px; } .home-tile small { display: none; } .home-tile .ico { font-size: 30px; }
    .home-tile .cnt { font-size: 16px; top: 10px; right: 10px; }
    .navclose { position: absolute; top: 8px; right: 6px; background: transparent; border: 0; color: #fff; font-size: 26px; padding: 6px 12px; cursor: pointer; }
    .main { padding: 12px 10px 70px; }
    .page-title { display: none; }
    .custbar { flex-wrap: nowrap; overflow-x: auto; margin: 0 0 12px; }
    .custbar a { flex: none; }
    /* 여러 칸으로 나뉜 것은 한 줄에 하나씩, 넓은 표는 옆으로 밀어서 봄 */
    .form-grid, .cols, .kpis { grid-template-columns: 1fr !important; }
    .main [style*="grid-template-columns"]:not(.keep-cols) { grid-template-columns: 1fr !important; }
    .kpis { grid-template-columns: 1fr 1fr !important; }
    .toolbar { gap: 6px; } .toolbar label.f { flex: 1 1 130px; min-width: 0; } .toolbar label.f input, .toolbar label.f select { width: 100%; }
    .card { padding: 12px; }
    input, select, textarea { font-size: 16px !important; }       /* 16px 미만이면 휴대폰이 화면을 확대해 버림 */
    .btn { padding: 10px 14px; white-space: normal; max-width: 100%; }
    .form-actions { flex-wrap: wrap; }
    .main img { max-width: 100%; }
    table.grid { font-size: 13px; }
    table.grid th, table.grid td { white-space: nowrap; }
    .table-wrap { -webkit-overflow-scrolling: touch; }
}
