* { box-sizing: border-box; }
body { margin: 0; font-family: "Malgun Gothic", sans-serif; font-size: 14px; background: #f3f5f8; color: #1d2430; }
header { display: flex; align-items: center; gap: 18px; background: #1f3b63; color: #fff; padding: 0 18px; height: 50px; }
header .brand { font-weight: bold; font-size: 16px; white-space: nowrap; }
header nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
header nav a { color: #d5e1f2; text-decoration: none; padding: 6px 10px; border-radius: 4px; }
header nav a.on, header nav a:hover { background: #2f5389; color: #fff; }
header .who { white-space: nowrap; font-size: 13px; }
header .who a, header .link { color: #d5e1f2; margin-left: 8px; }
.link { background: none; border: none; cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.badge { background: #e5484d; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 12px; }
main { max-width: 1100px; margin: 20px auto; padding: 0 16px; }
.card { background: #fff; border: 1px solid #dde2ea; border-radius: 6px; padding: 18px 20px; margin-bottom: 16px; }
h2 { margin: 0 0 14px; font-size: 18px; }
h3 { margin: 18px 0 8px; font-size: 15px; }
label { display: block; font-weight: bold; margin: 10px 0 4px; font-size: 13px; }
input[type=text], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: 7px 9px; border: 1px solid #c4ccd8; border-radius: 4px; font: inherit; background: #fff; }
textarea { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
button, .btn { background: #2563c9; color: #fff; border: none; border-radius: 4px; padding: 7px 14px; cursor: pointer;
  font: inherit; text-decoration: none; display: inline-block; }
button.gray, .btn.gray { background: #6b7685; }
button.red { background: #d93636; }
button.small { padding: 3px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { border-bottom: 1px solid #e3e7ee; padding: 8px 6px; text-align: left; }
table.list th { background: #f0f3f8; font-size: 13px; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: #f4f8ff; }
.st { padding: 2px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.st.진행 { background: #fff3d6; color: #8a5a00; }
.st.완료 { background: #dcf5e3; color: #146c2e; }
.st.반려 { background: #fde2e2; color: #a61b1b; }
.st.회수 { background: #e8ebf0; color: #4a5566; }
.paste { border: 2px dashed #9fb3d1; border-radius: 6px; padding: 14px; min-height: 60px; color: #5a6b85; background: #f8fbff;
  outline: none; }
.paste:focus { border-color: #2563c9; background: #eef4ff; }
table.grid { border-collapse: collapse; margin-top: 8px; font-size: 13px; }
table.grid td { border: 1px solid #b9c2cf; padding: 3px 6px; min-width: 40px; }
table.grid td.n { text-align: right; }
.steps .step { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.steps .step .no { width: 24px; text-align: center; color: #6b7685; }
.steps .step select { width: auto; flex: 1; }
.steps .step select.kind { flex: 0 0 90px; }
.muted { color: #6b7685; font-size: 12px; }
.flow { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.flow .p { border: 1px solid #c4ccd8; border-radius: 4px; padding: 4px 8px; font-size: 13px; background: #fff; }
.flow .p.승인 { border-color: #2c9a4c; background: #effaf2; }
.flow .p.반려 { border-color: #d93636; background: #fdeeee; }
.flow .p.cur { border-color: #2563c9; box-shadow: 0 0 0 2px #c9dafc; }
iframe.pdf { width: 100%; height: 720px; border: 1px solid #dde2ea; border-radius: 4px; background: #fff; }
.actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1d2430; color: #fff;
  padding: 10px 18px; border-radius: 6px; z-index: 9; }
#toast.err { background: #b42323; }
.tb { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; background: #eef1f6; border: 1px solid #c4ccd8;
  border-bottom: none; border-radius: 4px 4px 0 0; padding: 5px; }
.tb button { background: #fff; color: #1d2430; border: 1px solid #c4ccd8; padding: 4px 10px; font-size: 13px; }
.tb button:hover { background: #e2eaf7; }
.tb button.on { background: #cfdcf3; border-color: #2563c9; }
.tb select { width: auto; padding: 4px 6px; font-size: 13px; }
.tb .sep { width: 1px; height: 22px; background: #c4ccd8; margin: 0 4px; }
.editor { border: 1px solid #c4ccd8; border-radius: 0 0 4px 4px; min-height: 220px; max-height: 70vh; overflow: auto;
  padding: 12px 14px; background: #fff; font-size: 10pt; line-height: 1.35; outline: none; }
.editor:focus { border-color: #2563c9; }
.editor:empty::before { content: attr(data-ph); color: #9aa5b5; }
.editor table { border-collapse: collapse; }
.editor td { padding: 0.75pt 0.75pt 0 0.75pt; outline: 1px dotted #d3d9e2; outline-offset: -1px; }
.editor td[style*="text-align-last"] { text-justify: inter-character; }  /* 엑셀 균등 분할 */
table.users input[type=text], table.users input[type=date] { padding: 4px 6px; min-width: 70px; }
table.users input.e_phone { min-width: 120px; }
table.users td, table.users th { white-space: nowrap; }
.tabs, .tpl-pick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
button.tab { background: #fff; color: #1d2430; border: 1px solid #c4ccd8; border-radius: 16px; padding: 5px 14px; }
button.tab:hover { background: #eef3fb; }
button.tab.on { background: #2563c9; border-color: #2563c9; color: #fff; }
.tpl { display: flex; gap: 16px; align-items: flex-start; }
.tpl-side { flex: 0 0 260px; }
.tpl-main { flex: 1; min-width: 0; }
.tpl-list { list-style: none; margin: 0; padding: 0; }
.tpl-list li { padding: 9px 10px; border: 1px solid #e3e7ee; border-radius: 5px; margin-bottom: 6px; cursor: pointer; }
.tpl-list li:hover { background: #f4f8ff; }
.tpl-list li.on { border-color: #2563c9; background: #eef4ff; }
@media (max-width: 760px) { .tpl { flex-direction: column; } .tpl-side { flex: none; width: 100%; } }
.rz-guide { position: fixed; z-index: 20; pointer-events: none; }
.login { max-width: 380px; margin: 80px auto; }
