:root {
  --bg: #f3f5f4;
  --card: #ffffff;
  --border: #e4e8e6;
  --text: #1c2421;
  --muted: #6b7570;
  --primary: #1f6f4a;
  --primary-dark: #185a3c;
  --primary-soft: #e4f2ea;
  --sidebar: #1e4a37;
  --sidebar-text: #d8e6de;
  --sidebar-muted: #8fb2a0;
  --radius: 12px;

  --yellow-bg: #fdf3d6; --yellow: #8a6100;
  --green-bg: #e3f4ea;  --green: #1d7a45;
  --red-bg: #fde4e2;    --red: #b4322a;
  --blue-bg: #e3edfc;   --blue: #2557b8;
  --orange-bg: #fdeadb; --orange: #b45a12;
  --gray-bg: #eef0ef;   --gray: #5d6762;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }

/* ---------- 레이아웃 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex-shrink: 0;
  background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; padding: 28px 32px; max-width: 1320px; width: 100%; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }
.topbar { display: none; }
.sidebar-backdrop { display: none; }

/* ---------- 사이드바 ---------- */
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px; background: #fff; color: var(--sidebar);
  display: grid; place-items: center; font-weight: 800; font-size: 12px;
}
.brand-name { font-weight: 700; font-size: 15px; color: #fff; flex: 1; }
/* 회사 로고가 있을 때: 흰 바탕 상자에 로고, 아래에 '그룹웨어' */
.brand, .login-brand { flex-wrap: wrap; }
.brand-img { width: 100%; display: flex; justify-content: center; align-items: center; }
.brand-img img { max-width: 100%; display: block; }
.brand-img.side { background: #fff; border-radius: 10px; padding: 8px 12px; }
.brand-img.side img { max-height: 44px; }
.brand-img.login img { max-height: 64px; }
.brand-sub { width: 100%; text-align: center; font-size: 12px; letter-spacing: 2px; color: var(--sidebar-muted); }
.login-brand .brand-sub { color: var(--muted); }
.nav { padding: 4px 10px 12px; flex: 1; }
.nav-group { margin-top: 14px; }
.nav-group-title {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--sidebar-muted); padding: 4px 10px; cursor: pointer; user-select: none;
}
.nav-group-title svg.lucide { width: 14px; height: 14px; transition: transform .15s; }
.nav-group.collapsed .nav-group-title svg.lucide { transform: rotate(-90deg); }
.nav-group.collapsed .nav-items { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; color: var(--sidebar-text);
  text-decoration: none; font-size: 14px;
}
.nav-item:hover { background: rgba(255,255,255,.07); }
.nav-item.active { background: rgba(255,255,255,.15); color: #fff; font-weight: 600; }
.nav-item .label { flex: 1; }
.nav-badge {
  background: #e5484d; color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px;
}
.nav-admin {
  background: #f5c542; color: #4a3800; font-size: 10px; font-weight: 800;
  padding: 2px 6px; border-radius: 4px; letter-spacing: .3px;
}
.sidebar-foot { padding: 12px 14px 16px; text-align: center; }
.sidebar-foot .ver { font-size: 11px; opacity: .7; margin-top: 4px; }

/* ---------- 공통 요소 ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 4px; font-size: 22px; }
.page-head p { margin: 0; color: var(--muted); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; min-width: 0;
}
.card-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin: 0 0 14px; }
.card-title .spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mt { margin-top: 16px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: #fff; border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.btn:hover { background: #f6f8f7; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-ok { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-ok:hover { background: var(--primary-dark); }
.btn-danger { color: var(--red); }
.icon-btn { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--muted); border-radius: 6px; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--gray-bg); color: var(--text); }
.icon-btn.danger:hover { color: var(--red); background: var(--red-bg); }
.icon-btn svg.lucide { width: 16px; height: 16px; }

.chip {
  display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.chip.yellow { background: var(--yellow-bg); color: var(--yellow); }
.chip.green  { background: var(--green-bg);  color: var(--green); }
.chip.red    { background: var(--red-bg);    color: var(--red); }
.chip.blue   { background: var(--blue-bg);   color: var(--blue); }
.chip.orange { background: var(--orange-bg); color: var(--orange); }
.chip.gray   { background: var(--gray-bg);   color: var(--gray); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.text-red { color: var(--red); font-weight: 600; }
.text-orange { color: var(--orange); font-weight: 600; }

/* 탭 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; }
.tab {
  background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* 필터 */
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.filters .spacer { flex: 1; }
select, input[type=text], input[type=date], input[type=time], input[type=number], textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; background: #fff; min-width: 0;
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--text) !important; cursor: pointer; }

/* 테이블 */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; }
table.table.wide { min-width: 980px; }
table.table.compact { min-width: 520px; }
.table td.reason { min-width: 160px; }
.task-title > span:last-child { min-width: 200px; }
.table th {
  text-align: left; font-weight: 600; color: var(--muted); background: #f7f9f8;
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid #eef1ef; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafcfb; }
.table .nowrap { white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 36px 0 !important; }

/* 진척률 막대 */
.bar { position: relative; height: 7px; background: #e8ecea; border-radius: 4px; overflow: visible; min-width: 80px; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--blue); }
.bar.warn > span { background: #e08a2c; }
.bar.done > span { background: var(--green); }
.bar .expect { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #3b4642; border-radius: 1px; }

/* 안내 배너 */
.banner {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px;
  background: var(--yellow-bg); color: var(--yellow); margin-bottom: 16px; font-weight: 500;
}
.banner .spacer { flex: 1; }

/* ---------- 모달 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 25, 20, .45);
  display: grid; place-items: center; padding: 16px; z-index: 100;
}
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px 20px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: #3d4843; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field input, .field select, .field textarea { width: 100%; }
.field textarea { min-height: 72px; resize: vertical; }
.hint { font-size: 12px; color: var(--muted); }

/* 토스트 */
#toastRoot { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; }
.toast { background: #24302b; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.18); animation: toastIn .2s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 대시보드 ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.dash-head h1 { margin: 0 0 4px; font-size: 22px; }
.dash-head p { margin: 0; color: var(--muted); }
.dash-tools { display: flex; align-items: center; gap: 10px; }
/* 내 알림함 (종 모양) */
.alert-bell { position: relative; }
.alert-btn { position: relative; width: 40px; height: 40px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.topbar .alert-btn { border: 0; background: none; }
.alert-cnt {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.alert-cnt[hidden] { display: none; }
.alert-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(380px, calc(100vw - 24px));
  background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14);
  text-align: left;
}
.alert-head .spacer, .topbar .spacer { flex: 1; }
.alert-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.alert-list { list-style: none; margin: 0; padding: 4px; max-height: min(480px, 70vh); overflow-y: auto; }
.alert-list li { display: flex; gap: 10px; padding: 10px; border-radius: 8px; cursor: pointer; }
.alert-list li:hover { background: var(--primary-soft); }
.alert-list li.unread { background: #f3f9f5; }
.alert-list li.unread .alert-title { font-weight: 700; }
.alert-list .grow { flex: 1; min-width: 0; display: grid; gap: 2px; }
.alert-title { overflow-wrap: anywhere; }
.alert-ico { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--gray-bg); color: var(--gray); }
.alert-ico svg.lucide { width: 16px; height: 16px; }
.alert-ico.approval { background: var(--primary-soft); color: var(--primary); }
.alert-ico.notice { background: var(--red-bg); color: var(--red); }
.alert-ico.task { background: var(--blue-bg); color: var(--blue); }
.alert-ico.leave, .alert-ico.cert { background: var(--green-bg); color: var(--green); }
.alert-empty { padding: 18px; text-align: center; cursor: default !important; }
.pill { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; color: var(--muted); }
.pill b { color: var(--text); margin-left: 8px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.list li + li { border-top: 1px dashed #edf0ee; }
.list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ot-item { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.ot-item + .ot-item { border-top: 1px dashed #edf0ee; }
.leave-row { display: grid; grid-template-columns: 64px 64px 1fr 82px; gap: 10px; align-items: center; padding: 7px 0; }
.leave-row b { font-weight: 600; }

/* ---------- 업무관리 ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; text-align: left;
}
.kpi:hover { border-color: #c9d3ce; }
.kpi.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.kpi .num { font-size: 22px; font-weight: 800; }
.kpi .ttl { font-weight: 700; margin-top: 2px; }
.kpi .desc { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi.red .num { color: var(--red); }
.kpi.orange .num { color: var(--orange); }
.kpi.blue .num { color: var(--blue); }
.task-title { display: flex; align-items: center; gap: 6px; }
.lv { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--gray-bg); color: var(--gray); }
.lv1 { background: var(--primary-soft); color: var(--primary); }
.toggle { width: 20px; height: 20px; display: inline-grid; place-items: center; cursor: pointer; border: 0; background: none; color: var(--muted); padding: 0; }
.toggle svg.lucide { width: 15px; height: 15px; transition: transform .15s; }
.toggle.closed svg.lucide { transform: rotate(-90deg); }
.toggle-spacer { width: 20px; display: inline-block; }
tr.lv1-row td { background: #fbfcfb; font-weight: 600; }
tr.clickable { cursor: pointer; }

/* ---------- 설정 화면 공통 폼 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-foot { display: flex; justify-content: flex-end; margin-top: 16px; }
.kv { display: grid; grid-template-columns: 80px 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.kv a { margin-left: 6px; color: var(--primary); }
.icon-btn:disabled { opacity: .3; cursor: default; background: none; }

/* ---------- 직인 ---------- */
.seal-wrap { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.seal-box {
  width: 140px; height: 140px; border: 1px dashed #c9d3ce; border-radius: 10px; background: #fafcfb;
  display: grid; place-items: center; text-align: center; padding: 10px; flex-shrink: 0;
}
.seal-box img { max-width: 100%; max-height: 100%; }
.seal-box.logo-box { width: 240px; height: 110px; background: #fff; }
.seal-actions { flex: 1; min-width: 180px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.seal-actions .hint { flex-basis: 100%; margin: 4px 0 0; }
label.btn { cursor: pointer; }

/* ---------- 조직도 ---------- */
.org-chart { display: flex; flex-direction: column; align-items: center; padding: 8px 0; overflow-x: auto; }
.org-node {
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px;
  display: grid; gap: 2px; text-align: center; position: relative;
}
.org-node span { color: var(--muted); font-size: 12px; }
.org-top { background: var(--primary); border-color: var(--primary); color: #fff; min-width: 180px; }
.org-top span { color: #cfe5d8; }
.org-top::after { content: ''; position: absolute; left: 50%; top: 100%; height: 20px; border-left: 2px solid #c9d3ce; }
.org-branches { display: flex; gap: 16px; justify-content: safe center; margin-top: 20px; width: 100%; }
.org-dept { position: relative; padding-top: 20px; flex: 1; min-width: 120px; max-width: 240px; }
.org-dept::before { content: ''; position: absolute; top: 0; left: -8px; right: -8px; border-top: 2px solid #c9d3ce; }
.org-dept:first-child::before { left: 50%; }
.org-dept:last-child::before { right: 50%; }
.org-dept::after { content: ''; position: absolute; top: 0; left: 50%; height: 20px; border-left: 2px solid #c9d3ce; }
.org-dept > .org-node { background: var(--primary-soft); border-color: #cfe5d8; }
.org-members { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.org-members li {
  display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #eef1ef;
  border-radius: 8px; padding: 7px 10px; font-size: 13px; flex-wrap: wrap;
}
.org-members li .chip { margin-left: auto; }

/* ---------- 공지사항 ---------- */
.modal.modal-wide { max-width: 720px; }
.page-head .actions { display: flex; gap: 8px; }
.notice-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.notice-title.unread > span:not(.chip):not(.muted) { font-weight: 700; }
.notice-title svg.lucide { width: 14px; height: 14px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.pin { color: var(--red); display: inline-grid; }
.pin svg.lucide { width: 15px; height: 15px; }
tr.notice-pinned td { background: #fffaf9; }
.notice-head { border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 18px; }
.notice-head h2 { margin: 8px 0 6px; font-size: 19px; }
.notice-body { white-space: pre-wrap; line-height: 1.8; min-height: 80px; }
.attach-list { list-style: none; margin: 18px 0 0; padding: 12px 14px; background: #fafcfb; border: 1px solid #eef1ef; border-radius: 10px; display: grid; gap: 8px; }
.attach-list:empty { display: none; }
.attach-list.edit { margin: 0; }
.attach-list li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.attach-list li > span:first-of-type, .attach-list a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-list a { color: var(--primary); }
.attach-list .spacer { flex: 1; }
.attach-list svg.lucide { width: 15px; height: 15px; color: var(--muted); }
.read-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.read-grid h3 { font-size: 14px; margin: 0 0 6px; }
.read-grid .spacer { flex: 1; }
.list a.grow { color: inherit; text-decoration: none; }
.list a.grow:hover { color: var(--primary); text-decoration: underline; }

/* ---------- 증명서 문서 (A4) ---------- */
.cert-stage { overflow-x: auto; padding-bottom: 8px; }
.cert-paper {
  width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff; color: #111;
  padding: 22mm 20mm; box-shadow: 0 2px 14px rgba(0,0,0,.08); border: 1px solid var(--border);
  font-family: "Batang", "바탕", "Nanum Myeongjo", serif; display: flex; flex-direction: column;
}
.cert-no { font-size: 13px; color: #333; }
.cert-title { text-align: center; font-size: 34px; letter-spacing: 6px; margin: 36px 0 44px; font-weight: 700; }
.cert-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.cert-table th, .cert-table td { border: 1px solid #333; padding: 14px 12px; }
.cert-table th { width: 18%; background: #f4f4f4; font-weight: 600; white-space: nowrap; }
.cert-statement { text-align: center; font-size: 18px; margin: 70px 0 40px; }
.cert-date { text-align: center; font-size: 17px; margin: 0 0 60px; }
.cert-company { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; font-size: 14px; line-height: 1.9; }
.cert-sign { font-size: 18px; white-space: nowrap; }
.cert-seal { position: relative; display: inline-block; margin-left: 10px; }
.cert-seal img { position: absolute; width: 76px; height: 76px; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: .9; }

@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .sidebar, .sidebar-backdrop, .topbar, .footer, .no-print, #toastRoot { display: none !important; }
  .content { padding: 0 !important; }
  .cert-stage { overflow: visible; padding: 0; }
  .cert-paper { box-shadow: none; border: 0; margin: 0; width: 210mm; height: 297mm; }
}

/* ---------- 준비 중 화면 ---------- */
.placeholder { text-align: center; padding: 48px 20px; }
.placeholder > svg.lucide { width: 36px; height: 36px; color: var(--muted); margin-bottom: 10px; }
.placeholder h2 { margin: 0 0 8px; font-size: 17px; }
.placeholder ul { text-align: left; display: inline-block; margin: 16px 0 0; padding-left: 18px; color: #3d4843; line-height: 1.9; }

/* ---------- 탭 건수·비활성 버튼 ---------- */
.tab-cnt { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--gray-bg); color: var(--gray); font-size: 11px; line-height: 18px; text-align: center; }
.tab-cnt.strong { background: var(--primary); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- 로그인 ---------- */
#loginRoot { display: none; }
body.logged-out .layout { display: none; }
body.logged-out #loginRoot { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 26px; display: grid; gap: 14px; box-shadow: 0 12px 40px rgba(20, 40, 30, .08);
}
.login-brand { display: flex; align-items: center; gap: 10px; color: var(--sidebar); }
.login-brand .brand-logo { background: var(--sidebar); color: #fff; }
.login-card h1 { margin: 6px 0 2px; font-size: 22px; }
.login-card .field input { width: 100%; padding: 10px 12px; }
.login-btn { justify-content: center; padding: 11px; font-size: 15px; }
.login-error { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--red-bg); color: var(--red); font-size: 13px; }
.login-card .hint { margin: 0; text-align: center; }

.user-box {
  display: flex; align-items: center; gap: 8px; text-align: left; margin-bottom: 10px;
  padding: 8px; border-radius: 10px; background: rgba(255,255,255,.07);
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.85); color: var(--sidebar);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; color: #fff; font-size: 13px; }
.user-info b { font-weight: 600; }
.user-info small { display: block; margin: 1px 0 0; color: var(--sidebar-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-btn { background: none; border: 0; padding: 5px; border-radius: 6px; color: var(--sidebar-text); cursor: pointer; display: grid; place-items: center; }
.user-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.user-btn svg.lucide { width: 16px; height: 16px; }
.temp-pw { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--gray-bg); }
.temp-pw code { flex: 1; font-size: 20px; font-weight: 700; letter-spacing: 1px; font-family: Consolas, "D2Coding", monospace; user-select: all; }

/* ---------- 결재 ---------- */
.form-foot { gap: 8px; }
.line-editor { display: grid; gap: 14px; }
.line-editor .field > span small { font-weight: 400; margin-left: 6px; }
.line-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.line-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fafcfb; }
.line-list li.muted { border-style: dashed; background: none; }
.line-list .grow { flex: 1; min-width: 0; }
.line-no { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:empty { display: none; }
.person-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border-radius: 16px; background: var(--blue-bg); color: var(--blue); font-size: 13px; }
.person-chip button { border: 0; background: none; padding: 0; color: inherit; cursor: pointer; display: grid; }
.person-chip svg.lucide { width: 14px; height: 14px; }
.doc-head { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 14px; }
.doc-head h2 { margin: 6px 0 4px; font-size: 19px; }
.doc-memo { margin-top: 12px; padding: 12px 14px; border-radius: 8px; background: #fafcfb; border: 1px solid #eef1ef; white-space: pre-wrap; }
.flow { display: flex; gap: 10px; flex-wrap: wrap; }
.flow-step {
  min-width: 130px; flex: 0 1 auto; display: grid; gap: 4px; justify-items: start;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
.flow-step.done, .flow-step.approved { border-color: #bfe3cc; background: #f4fbf6; }
.flow-step.pending { border-color: #f0d68c; background: #fffbef; box-shadow: 0 0 0 2px #fdf3d6; }
.flow-step.rejected { border-color: #f3b9b4; background: #fff6f5; }
.flow-comment { color: #3d4843; max-width: 220px; }
input.amt { width: 120px; text-align: right; }
.decide { border-color: #f0d68c; }

/* ---------- 경비 ---------- */
[hidden] { display: none !important; }
.exp-sum { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: flex-start; margin-bottom: 14px; padding: 12px 14px; border-radius: 10px; background: #fafcfb; border: 1px solid #eef1ef; }
.exp-sum > div:not(.exp-cats) { display: grid; gap: 2px; }
.exp-sum b { font-size: 18px; }
.exp-cats { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 200px; }
.exp-cat { padding: 3px 9px; border-radius: 6px; background: #fff; border: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.exp-cat b { font-size: 12px; color: var(--text); margin-left: 4px; }
.receipt-link { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); white-space: nowrap; }
.receipt-link svg.lucide { width: 14px; height: 14px; }
.settle td { padding: 9px 10px; }
.settle-net td { background: var(--primary-soft); }

/* ---------- 반응형 ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s;
  }
  .sidebar.open { transform: none; }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
  .topbar {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fff;
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30;
  }
  .topbar-title { font-weight: 700; }
  .dash-tools .alert-bell { display: none; } /* 휴대폰 화면은 상단바의 알림함을 쓴다 */
  .content { padding: 18px 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .card { padding: 16px; }
}
@media (max-width: 600px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-row { grid-template-columns: 1fr; }
  .form-grid, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .read-grid { grid-template-columns: 1fr; }
  .org-branches { flex-direction: column; align-items: stretch; }
  .org-dept { max-width: none; }
  .org-dept::before { display: none; }
  .leave-row { grid-template-columns: 60px 1fr 72px; }
  .leave-row .hide-sm { display: none; }
}
