*{box-sizing:border-box}
body{margin:0;font-family:"Malgun Gothic","Apple SD Gothic Neo",sans-serif;font-size:14px;color:#222;background:#f4f6f9}
a{color:#8f6a14;text-decoration:none}a:hover{text-decoration:underline}
.top{display:flex;align-items:center;gap:18px;background:#1f1b16;color:#fff;padding:0 20px;height:48px;position:sticky;top:0;z-index:10}
.top a{color:#e9e0cf}.brand{font-weight:700;color:#fff!important;font-size:16px;display:flex;align-items:center;gap:8px}.brand img{border-radius:7px}
.top nav{display:flex;gap:16px;flex:1;flex-wrap:wrap}.who{font-size:13px;display:flex;gap:10px;align-items:center}
.badge{background:#e5484d;color:#fff;border-radius:9px;padding:0 6px;margin-left:4px;font-size:11px}
main{max-width:1100px;margin:20px auto;padding:0 16px}
h2{margin:0 0 14px;font-size:20px}h3{margin:22px 0 8px;font-size:15px}
.card{background:#fff;border:1px solid #dde3ec;border-radius:8px;padding:16px;margin-bottom:16px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px}
.formcard{display:block;background:#fff;border:1px solid #dde3ec;border-radius:8px;padding:22px;text-align:center;font-size:16px;font-weight:600;color:#1f1b16}
.formcard:hover{border-color:#c9a24d;text-decoration:none;box-shadow:0 2px 8px #0001}
table{border-collapse:collapse;width:100%;background:#fff}
th,td{border:1px solid #dde3ec;padding:7px 9px;text-align:left;vertical-align:top}
th{background:#f0f3f8;font-weight:600;white-space:nowrap}
.list td,.list th{font-size:13px}.list tr:hover td{background:#fafcff}
input[type=text],input[type=password],input[type=date],input[type=number],select,textarea{width:100%;padding:7px 8px;border:1px solid #c5ceda;border-radius:5px;font:inherit;background:#fff}
textarea{resize:vertical}
.btn,button{display:inline-block;padding:7px 14px;border:1px solid #c5ceda;border-radius:5px;background:#fff;cursor:pointer;font:inherit;color:#222}
.btn:hover,button:hover{background:#eef2f8;text-decoration:none}
.btn.pri,button.pri{background:#c9a24d;border-color:#c9a24d;color:#1f1b16;font-weight:700}.btn.pri:hover,button.pri:hover{background:#b58f3e}
.btn.danger,button.danger{background:#fff;border-color:#e5484d;color:#c62a2f}
.btn.sm,button.sm{padding:2px 8px;font-size:12px}
.flash{padding:10px 14px;border-radius:6px;margin-bottom:12px}.flash.ok{background:#e6f6ec;border:1px solid #9bd5b0}.flash.err{background:#fdecec;border:1px solid #f1a5a8}
.tabs{display:flex;gap:4px;margin-bottom:12px;border-bottom:2px solid #dde3ec}
.tabs a{padding:8px 16px;color:#555}.tabs a.on{color:#8f6a14;font-weight:700;border-bottom:2px solid #c9a24d;margin-bottom:-2px}
.st{display:inline-block;padding:1px 8px;border-radius:10px;font-size:12px;background:#e8ecf3}
.st.진행중{background:#fff3cd}.st.완료{background:#d8f1e0}.st.반려{background:#fde0e0}.st.임시저장{background:#e8ecf3}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.muted{color:#778}.right{text-align:right}
em{color:#d33;font-style:normal}
.formtbl th{width:150px}.line td{padding:4px 6px}.line .mv{white-space:nowrap;width:70px}
.login{max-width:340px;margin:90px auto}.login h2{text-align:center}.login .card input{margin-bottom:10px}
/* 문서(인쇄용 결재 양식) */
.paper{background:#fff;border:1px solid #c9d1de;max-width:800px;margin:0 auto 16px;padding:36px 40px}
.paper-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:22px;gap:20px}
.paper h1{font-size:30px;letter-spacing:10px;margin:14px 0 0;flex:1;text-align:center}
.appr{width:auto;border:1.5px solid #333}.appr th,.appr td{border:1px solid #333;text-align:center;padding:3px 0;min-width:78px}
.appr th{background:#f3f3f3;font-size:12px;padding:3px 6px}.appr td.sig{height:58px;vertical-align:middle;font-size:13px;position:relative}
.appr td.dt{font-size:11px;height:20px;color:#444}
.stamp{display:inline-block;border:2px solid #d33;color:#d33;border-radius:50%;width:34px;height:34px;line-height:30px;font-size:11px;font-weight:700;margin-top:2px}
.stamp.rej{border-color:#555;color:#555}.nm{display:block;font-size:12px}
.meta{margin-bottom:12px}.meta th{width:90px}.body th{width:130px}.pre{white-space:pre-wrap;min-height:20px}
.reject-box{background:#fdecec;border:1px solid #f1a5a8;border-radius:6px;padding:10px 14px;margin-bottom:12px}
.actions{max-width:800px;margin:0 auto 12px;display:flex;gap:8px;flex-wrap:wrap}
.approve-box{max-width:800px;margin:0 auto 16px}
/* 캘린더 */
.cal{table-layout:fixed}.cal th{text-align:center}.cal td{height:96px;padding:3px;font-size:12px}
.cal .dn{font-weight:700;font-size:12px}.cal td.out{background:#f6f7f9;color:#aab}.cal td.sun .dn,.cal td.hol .dn{color:#d33}.cal td.sat .dn{color:#2563c9}
.cal td.today{outline:2px solid #c9a24d;outline-offset:-2px}.hn{color:#d33;font-size:11px;margin-left:4px}
.chip{display:block;border-radius:3px;padding:1px 4px;margin-top:2px;font-size:11.5px;line-height:1.35}
.chip.annual{background:#dbe8ff}.chip.half{background:#d3f1ee}.chip.other{background:#e8e8e8}.chip.trip{background:#ffe6c7}
.cal-title{font-size:20px;font-weight:700;margin:0 12px}
.checks label{margin-right:14px;white-space:nowrap}
@media print{
 body{background:#fff;-webkit-print-color-adjust:exact;print-color-adjust:exact}.noprint,.top,.signbanner,#toasts,footer{display:none!important}
 main{margin:0;max-width:none;padding:12mm 14mm}
 .paper{border:none;padding:0;max-width:none;margin:0}.card{border:none;padding:0}.cal td{height:90px}
 .paper-head{display:flex!important;flex-direction:row!important;justify-content:space-between;align-items:flex-start}
 .appr{width:auto!important;table-layout:auto!important}.appr th,.appr td{min-width:96px!important}
 table,tr,.appr{page-break-inside:avoid}
 @page{size:A4;margin:0}      /* 여백 0 → 브라우저가 찍는 머리글·바닥글(날짜, 제목, 주소, 쪽번호) 자동 제거. 여백은 위 main padding 으로 줌 */
}
.brand small{font-weight:400;font-size:11px;opacity:.7;margin-left:3px}
#toasts{position:fixed;right:16px;bottom:16px;z-index:50;display:flex;flex-direction:column;gap:8px;max-width:340px}
.toast{display:block;background:#1f1b16;color:#fff!important;border-radius:8px;padding:10px 14px;box-shadow:0 4px 14px #0004;font-size:13px}
.toast b{display:block;margin-bottom:2px}.toast:hover{text-decoration:none;background:#2e2820}
.stamp.skip{border-color:#888;color:#888;font-size:10px}.stamp.final{border-color:#c0392b;color:#c0392b}
.unread td{background:#f3f8ff;font-weight:600}
code{background:#eef1f6;padding:1px 5px;border-radius:3px}
button.final{background:#c0392b;border-color:#c0392b;color:#fff}button.final:hover{background:#a93226}
button.final{background:#c0392b;border-color:#c0392b;color:#fff}button.final:hover{background:#a93226}
.appr th,.appr td{min-width:104px}.appr .nm{font-size:11.5px;padding:0 3px}
main>.row:first-child{margin-bottom:14px}

.brand img{flex:none;width:28px;height:28px}
.top{min-height:48px;height:auto;padding-top:0;padding-bottom:0}
.dd{position:relative}.dd summary{cursor:pointer;color:#e9e0cf;list-style:none}.dd summary::-webkit-details-marker{display:none}
.dd>div{position:absolute;top:30px;left:0;background:#1f1b16;border:1px solid #3a332a;border-radius:8px;padding:6px;min-width:150px;display:flex;flex-direction:column;box-shadow:0 6px 18px #0006;z-index:20}
.dd>div a{padding:7px 10px;border-radius:5px;white-space:nowrap}.dd>div a:hover{background:#2e2820;text-decoration:none}
.dd .sub{display:block}.dd .sub>summary{padding:8px 10px;border-radius:5px;font-weight:700;color:#f3ead8;cursor:pointer}.dd .sub>summary:hover{background:#2e2820}.dd .sub>summary::after{content:'▸';float:right;margin-left:14px;color:#a89c85}.dd .sub[open]>summary::after{content:'▾'}.dd .sub>a{display:block;padding:6px 10px 6px 22px;font-size:13px}
/* 결재란 싸인/도장 이미지 */
.signbox{position:relative;display:flex;align-items:center;justify-content:center;height:54px;margin-top:2px}   /* 싸인을 칸 가운데로 */
.signimg{max-height:48px;max-width:92px;width:auto;height:auto;object-fit:contain;mix-blend-mode:multiply;display:block;margin:0 auto}
.signbox .tag{position:absolute;right:1px;top:-1px;font-size:9px;line-height:1;border:1px solid #d33;color:#d33;border-radius:8px;padding:1px 4px;background:#fff}
.signbox .tag.final{border-color:#c0392b;color:#fff;background:#c0392b}
.signbanner{background:#fff4d6;border-bottom:1px solid #f0c36d;color:#6b4a00;padding:8px 16px;font-size:13px;text-align:center}
.signbanner a{font-weight:700;text-decoration:underline}
.signpad{border:1px dashed #b9a77a;border-radius:8px;background:#fff;touch-action:none;max-width:100%;cursor:crosshair}
.signprev{display:inline-block;border:1px solid #dde3ec;border-radius:8px;padding:8px 14px;background:#fff;background-image:linear-gradient(45deg,#f1f1f1 25%,transparent 25%,transparent 75%,#f1f1f1 75%),linear-gradient(45deg,#f1f1f1 25%,transparent 25%,transparent 75%,#f1f1f1 75%);background-size:14px 14px;background-position:0 0,7px 7px}
.signprev img{max-height:90px;max-width:260px;display:block}
@media screen and (max-width:820px){
 .top{flex-wrap:wrap;height:auto;padding:6px 12px;gap:4px 10px}
 .brand{order:1;font-size:15px}.brand small{display:none}
 .who{order:2;margin-left:auto;font-size:12px;gap:8px;flex-wrap:wrap;justify-content:flex-end}
 .top nav{order:3;flex:0 0 100%;flex-wrap:nowrap;overflow-x:auto;gap:18px;padding:6px 0 8px;border-top:1px solid #3a332a;-webkit-overflow-scrolling:touch}
 .top nav a,.dd summary{white-space:nowrap;font-size:14px}
 .dd>div{position:fixed;left:12px;right:12px;top:98px;min-width:0}
 main{margin:14px auto;padding:0 12px}
 .card{overflow-x:auto}
 h2{font-size:18px}
 #toasts{left:12px;right:12px;max-width:none}
}

/* PC 앱 창(pywebview)은 기본적으로 글자 선택을 막으므로, 화면 쪽에서도 드래그·복사를 허용 (버튼 제외) */
body,body *{-webkit-user-select:text!important;user-select:text!important}
button,.btn,summary,nav a,.brand{-webkit-user-select:none!important;user-select:none!important}

/* 결재란: 이름 + 작은 승인 표시(한 줄), 그 아래 싸인/도장 이미지 */
.appr .nm{display:flex;justify-content:center;align-items:center;gap:4px;font-size:12px;padding:3px 2px 0;white-space:nowrap}
.appr .tag{display:inline-block;font-size:9px;line-height:1;border:1px solid #d33;color:#d33;border-radius:8px;padding:2px 4px;background:#fff;font-weight:700}
.appr .tag.final{border-color:#c0392b;color:#fff;background:#c0392b}.appr .tag.rej{border-color:#555;color:#555}.appr .tag.skip{border-color:#999;color:#999}
.appr .signbox{position:static;display:flex;align-items:center;justify-content:center;height:56px;margin:0}   /* 싸인을 칸 가운데로 */
.appr .signimg{max-height:46px;max-width:90%;margin:0 auto}
.appr td.sig{height:auto;vertical-align:top}
@media screen and (max-width:820px){
 .paper{padding:14px 10px;overflow-x:auto}
 .paper-head{flex-direction:column!important;align-items:stretch!important;gap:8px}
 .paper-head h1{text-align:center;font-size:22px;margin:4px 0}
 .appr{width:100%;table-layout:fixed}
 .appr th,.appr td{min-width:0!important}
 .appr .nm{font-size:11px;gap:2px}.appr .signimg{max-width:70px}.appr td.dt{font-size:10px}
 table.meta th,table.meta td{padding:5px 6px}
}
.appr .vac{display:block;font-size:10.5px;color:#6b5a2e;background:#faf5e8;border:1px dashed #c9a24d;border-radius:4px;margin:4px 6px 0;padding:3px 2px;line-height:1.35}
