/* 프로젝트 캘린더 - 화면 스타일 */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f3;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --text: #1c2433;
  --text-2: #44506a;
  --muted: #677189;
  --faint: #9aa3b5;
  --primary: #2f6fed;
  --primary-600: #2459c9;
  --primary-50: #edf3ff;
  --danger: #d92d20;
  --danger-50: #fef1f0;
  --warn: #c4600a;
  --warn-50: #fff6e8;
  --ok: #08875b;
  --ok-50: #e9f8f0;
  --sun: #d92d20;
  --sat: #2f6fed;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, .18);
  --header-h: 56px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.boot-loading { padding: 48px; text-align: center; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 버튼·입력 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible, .seg button:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-danger { color: var(--danger); border-color: #f3c5c1; }
.btn-danger:hover { background: var(--danger-50); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #b42318; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--text-2); position: relative; }
.icon-btn:hover { background: var(--surface-3); }
.icon-btn.sm { width: 28px; height: 28px; }
.ico { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }
.ico.sm { width: 15px; height: 15px; }
.ico.lg { width: 22px; height: 22px; }

input[type=text], input[type=password], input[type=date], input[type=month], input[type=time], input[type=number], input[type=email], input[type=url], input[type=search], input[type=tel], select, textarea {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.55; }
select { padding-right: 28px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23677189' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 111, 237, .16); }
input.sm, select.sm { height: 32px; font-size: 13px; }
input[type=color] { width: 38px; height: 38px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; vertical-align: -3px; }
label { cursor: pointer; }

.field { display: block; margin: 0 0 14px; }
.field > span, .field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field .hint, .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .req { color: var(--danger); margin-left: 2px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text); margin: 4px 14px 4px 0; user-select: none; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.danger-text { color: var(--danger); }
.warn-text { color: var(--warn); }
.ok-text { color: var(--ok); }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; border: 0; }

/* 분할 버튼 */
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 7px; font-weight: 600; font-size: 13.5px; color: var(--text-2); white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg.sm button { height: 26px; padding: 0 9px; font-size: 12.5px; }
.seg.wrap { flex-wrap: wrap; }

/* 칩 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary-50); border-color: var(--primary); color: var(--primary); font-weight: 700; }
.chip .x { margin-left: 2px; opacity: .6; }

.ptag { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-weight: 600; font-size: 13px; color: var(--text); min-width: 0; }
.ptag i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.ptag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptag.sm { font-size: 12px; gap: 5px; }
.ptag.sm i { width: 8px; height: 8px; border-radius: 2px; }

.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.pill.todo { background: #eef0f4; color: #44506a; }
.pill.doing { background: var(--primary-50); color: var(--primary-600); }
.pill.review { background: #f4edff; color: #6941c6; }
.pill.done { background: var(--ok-50); color: var(--ok); }
.pill.hold { background: #f2f4f7; color: #8a93a6; }
.pill.danger { background: var(--danger-50); color: var(--danger); }
.pill.warn { background: var(--warn-50); color: var(--warn); }
.pill.ok { background: var(--ok-50); color: var(--ok); }
.pill.info { background: var(--primary-50); color: var(--primary-600); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; }
.badge.grey { background: var(--surface-3); color: var(--text-2); }
.dday { font-weight: 800; font-size: 12px; color: var(--primary-600); background: var(--primary-50); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.dday.soon { color: var(--warn); background: var(--warn-50); }
.dday.over { color: var(--danger); background: var(--danger-50); }

/* ---------- 머리글 ---------- */
.app-header { position: sticky; top: 0; z-index: 40; height: var(--header-h); display: flex; align-items: center; gap: 16px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 6px; background: var(--text); flex: none; }
.brand-mark span { border-radius: 2px; }
.brand-mark span:nth-child(1) { background: #f08c4a; }
.brand-mark span:nth-child(2) { background: #59c27a; }
.brand-mark span:nth-child(3) { background: #5b9cf0; }
.brand-mark span:nth-child(4) { background: #fff; opacity: .9; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-company { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.brand-app { font-size: 15px; font-weight: 800; white-space: nowrap; letter-spacing: -.2px; }
.app-nav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.app-nav::-webkit-scrollbar { display: none; }
.app-nav a { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px; border-radius: 8px; font-weight: 600; color: var(--text-2); white-space: nowrap; font-size: 14px; }
.app-nav a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.app-nav a.on { background: var(--primary-50); color: var(--primary-600); }
.header-right { display: flex; align-items: center; gap: 4px; flex: none; }
.header-search { position: relative; width: 220px; }
.header-search input { height: 34px; padding-left: 32px; background: var(--surface-2); }
.header-search .ico { position: absolute; left: 10px; top: 8px; color: var(--muted); }
.icon-btn .badge { position: absolute; top: 2px; right: 1px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-50); color: var(--primary-600); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: none; }
.avatar.sm { width: 22px; height: 22px; font-size: 11px; }

.dropdown { position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.dropdown a, .dropdown button.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; color: var(--text); font-weight: 500; text-align: left; font-size: 14px; }
.dropdown a:hover, .dropdown button.menu-item:hover { background: var(--surface-3); text-decoration: none; }
.dropdown .menu-head { padding: 8px 10px 6px; font-size: 12px; color: var(--muted); font-weight: 700; }
.dropdown hr { border: 0; height: 1px; background: var(--border); margin: 6px 0; }
.rel { position: relative; }

.alerts-panel { width: 360px; max-height: 70vh; overflow: auto; padding: 8px; }
.alert-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 9px; }
.alert-item:hover { background: var(--surface-2); }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--primary); }
.alert-item.warn .alert-dot { background: var(--warn); }
.alert-item.danger .alert-dot { background: var(--danger); }
.alert-text { flex: 1; min-width: 0; font-size: 13.5px; cursor: pointer; }

/* ---------- 본문 ---------- */
.app-main { padding: 20px 24px 40px; max-width: 1480px; margin: 0 auto; }
.app-main.wide { max-width: none; padding: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-title { font-size: 21px; font-weight: 800; margin: 0; letter-spacing: -.3px; }
.page-sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 8px 16px 14px; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--border); }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.empty { padding: 26px 12px; text-align: center; color: var(--faint); font-size: 13.5px; }
.loading { padding: 32px; text-align: center; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: -4px; }
@keyframes spin { to { transform: rotate(360deg); } }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 14px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--primary-600); border-bottom-color: var(--primary); }
.tabs .count { font-size: 12px; color: var(--faint); margin-left: 3px; }

/* 목록(항목 줄) */
.item-list { list-style: none; margin: 0; padding: 0; }
.item-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); min-height: 44px; }
.item-row:last-child { border-bottom: 0; }
.item-row.clickable { cursor: pointer; border-radius: 8px; }
.item-row.clickable:hover { background: var(--surface-2); }
.item-row .stripe { width: 4px; align-self: stretch; border-radius: 3px; flex: none; }
.item-row .title { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row .title.done { text-decoration: line-through; color: var(--faint); font-weight: 500; }
.item-row .meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; flex: none; }
.tickbox { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border-strong); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0; color: #fff; }
.tickbox:hover { border-color: var(--ok); }
.tickbox.on { background: var(--ok); border-color: var(--ok); }
.tickbox .ico { width: 13px; height: 13px; }

table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font-weight: 700; color: var(--muted); font-size: 12.5px; padding: 9px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table tr.group td { background: var(--surface-3); font-weight: 800; color: var(--text-2); font-size: 13px; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table-wrap .table th:first-child, .table-wrap .table td:first-child { padding-left: 14px; }
.table td.done-title { text-decoration: line-through; color: var(--faint); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-width: 120px; height: 34px; font-size: 13.5px; }
.filters input[type=search] { min-width: 180px; }

.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.progress.blue > i { background: var(--primary); }
.progress.warn > i { background: var(--warn); }
.progress.danger > i { background: var(--danger); }

/* ---------- 프로젝트 카드 ---------- */
.pcard { position: relative; overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; }
.pcard:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, .12); transform: translateY(-1px); }
.pcard .color-bar { height: 5px; }
.pcard .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pcard .name { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.pcard .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 12px; color: var(--muted); }
.pcard .stats b { display: block; font-size: 15px; color: var(--text); }

/* ---------- 상세 패널(드로어) ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 40, .32); z-index: 80; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 81; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer-head { padding: 14px 16px 0; border-bottom: 1px solid var(--border); }
.drawer-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.drawer-title { width: 100%; border: 0; outline: none; font-size: 19px; font-weight: 800; padding: 6px 2px; background: transparent; border-bottom: 2px solid transparent; }
.drawer-title:focus { border-bottom-color: var(--primary); box-shadow: none; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; }
.drawer-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; background: var(--surface); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.drawer .tabs { margin-bottom: 0; border-bottom: 0; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 12px 12px; align-items: center; }
.kv > .k { font-size: 13px; font-weight: 700; color: var(--muted); }
.kv > .v { min-width: 0; }
.kv > .k.top { align-self: start; padding-top: 9px; }
.type-badge { font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.checklist li .t { flex: 1; min-width: 0; }
.checklist li.done .t { text-decoration: line-through; color: var(--faint); }

.stepper { display: flex; flex-wrap: wrap; gap: 4px; }
.stepper button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 7px; height: 30px; padding: 0 9px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.stepper button.past { background: var(--surface-3); color: var(--muted); border-color: var(--surface-3); }
.stepper button.on { background: var(--primary); color: #fff; border-color: var(--primary); }

.comment { padding: 10px 0; border-bottom: 1px solid var(--border); }
.comment .who { font-weight: 700; font-size: 13px; }
.comment .when { color: var(--faint); font-size: 12px; margin-left: 6px; }
.comment .body { white-space: pre-wrap; word-break: break-word; margin-top: 3px; }
.activity { list-style: none; padding: 0; margin: 0; }
.activity li { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.activity .when { color: var(--faint); font-size: 12px; }
.activity .chg { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.activity .chg b { color: var(--text-2); font-weight: 600; }
.attach { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.attach .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.drop-hint { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 16px; text-align: center; color: var(--muted); }
.drop-hint.over { border-color: var(--primary); background: var(--primary-50); }

/* ---------- 모달 ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; background: rgba(16, 24, 40, .38); overflow-y: auto; animation: fade .12s; }
.modal { width: min(560px, 100%); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.modal-body { padding: 18px; }
.modal-foot { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 14px 14px; }

.toast-stack { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #1c2433; color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; max-width: 92vw; animation: fade .15s; }
.toast.error { background: #b42318; }
.toast button { border: 0; background: rgba(255, 255, 255, .16); color: #fff; border-radius: 6px; height: 28px; padding: 0 10px; font-weight: 700; }

/* 색 고르기 */
.palette { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.swatch { width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; padding: 0; position: relative; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }
.swatch.used::after { content: ''; position: absolute; right: -3px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); }

/* ---------- 캘린더 ---------- */
.cal-layout { display: grid; grid-template-columns: 236px 1fr; min-height: calc(100vh - var(--header-h)); }
.cal-side { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 14px; overflow-y: auto; max-height: calc(100vh - var(--header-h)); position: sticky; top: var(--header-h); }
.cal-side h4 { margin: 16px 0 8px; font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .3px; display: flex; justify-content: space-between; align-items: center; }
.cal-side h4:first-child { margin-top: 0; }
.cal-side .legend label { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 7px; font-size: 13.5px; font-weight: 600; }
.cal-side .legend label:hover { background: var(--surface-2); }
.cal-side .legend input { display: none; }
.cal-side .legend .box { width: 15px; height: 15px; border-radius: 4px; border: 2px solid var(--c); background: var(--c); flex: none; display: inline-flex; align-items: center; justify-content: center; }
.cal-side .legend input:not(:checked) + .box { background: transparent; }
.cal-side .legend .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-side .legend .off .name { color: var(--faint); }
.cal-side .link-btn { border: 0; background: none; color: var(--primary); font-size: 12px; font-weight: 700; padding: 0; }
.cal-main { min-width: 0; padding: 14px 18px 30px; }
.cal-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-title { font-size: 20px; font-weight: 800; margin: 0 6px; letter-spacing: -.3px; white-space: nowrap; }
.cal-goals { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.goal-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.goal-chip:hover { border-color: var(--primary); }
.goal-chip .k { font-weight: 800; color: var(--primary-600); font-size: 12px; }
.goal-chip .progress { width: 60px; }
.cal-body { display: grid; grid-template-columns: 1fr; gap: 14px; }
.cal-body.with-tray { grid-template-columns: 1fr 250px; }
.cal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); min-width: 0; }
.tray { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; align-self: start; }
.tray h4 { margin: 0 0 4px; font-size: 14px; font-weight: 800; }
.tray .tray-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; margin: 6px 0; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: grab; font-size: 13px; font-weight: 600; box-shadow: inset 3px 0 0 var(--c); }
.tray .tray-item:hover { border-color: var(--border-strong); }
.tray .tray-item.done .t { text-decoration: line-through; color: var(--faint); }
.tray .tray-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* FullCalendar 덮어쓰기 */
.fc { --fc-border-color: #e9ecf1; --fc-today-bg-color: #f3f7ff; --fc-page-bg-color: #fff; --fc-neutral-bg-color: #f6f7f9; --fc-event-border-color: transparent; font-size: 13px; }
.fc .fc-col-header-cell-cushion { font-weight: 700; color: var(--text-2); padding: 7px 4px; font-size: 13px; text-decoration: none; }
.fc .fc-col-header-cell.fc-day-sun .fc-col-header-cell-cushion { color: var(--sun); }
.fc .fc-col-header-cell.fc-day-sat .fc-col-header-cell-cushion { color: var(--sat); }
.fc .fc-daygrid-day-top { flex-direction: row; justify-content: space-between; align-items: center; padding: 3px 5px 0; }
.fc .fc-daygrid-day-number { padding: 2px 4px; font-weight: 700; color: var(--text); text-decoration: none; font-size: 13px; }
.fc .day-num { font-weight: 700; }
.fc .fc-day-sun .day-num, .fc .fc-day.is-holiday .day-num { color: var(--sun); }
.fc .fc-day-sat .day-num { color: var(--sat); }
.fc .fc-day-sat.is-holiday .day-num { color: var(--sun); }
.fc .day-hol { font-size: 11px; font-weight: 600; color: var(--sun); margin-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px; display: inline-block; vertical-align: bottom; }
.fc .day-season { font-size: 11px; color: var(--faint); margin-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70px; display: inline-block; vertical-align: bottom; }
.fc .fc-day-today .day-num { background: var(--primary); color: #fff !important; border-radius: 999px; padding: 1px 7px; }
.fc .fc-daygrid-day.is-holiday { background: #fffafa; }
.fc .fc-daygrid-event { margin: 1px 3px 2px !important; border-radius: 5px; border: 0; }
.fc .fc-daygrid-block-event .fc-event-main, .fc .fc-daygrid-dot-event { padding: 0; }
.fc .fc-event { cursor: pointer; }
.fc .fc-h-event { background: transparent; border: 0; }
.fc-chip { display: flex; align-items: center; gap: 4px; padding: 2px 6px 2px 7px; border-radius: 5px; background: var(--tint); color: var(--text); box-shadow: inset 3px 0 0 var(--c); font-size: 12px; line-height: 1.45; overflow: hidden; white-space: nowrap; min-height: 21px; width: 100%; }
.fc-chip .cp { font-weight: 800; color: var(--c-dark, var(--text-2)); flex: none; max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
.fc-chip .ct { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.fc-chip .ci { flex: none; font-size: 11px; line-height: 1; }
.fc-chip .ctag { flex: none; font-size: 10.5px; font-weight: 800; padding: 0 4px; border-radius: 4px; background: rgba(255, 255, 255, .7); color: var(--text-2); }
.fc-chip.k-goal { background: #fff; box-shadow: inset 0 0 0 1.5px var(--c); }
.fc-chip.k-goal .ci { color: var(--c); }
.fc-chip.k-po { background: #fff; box-shadow: inset 0 0 0 1px var(--border-strong), inset 3px 0 0 var(--c); }
.fc-chip.k-po.late { box-shadow: inset 0 0 0 1.5px var(--danger), inset 3px 0 0 var(--c); }
.fc-chip.k-po.late .ctag { background: var(--danger); color: #fff; }
.fc-chip.k-event .ci { color: var(--c); }
.fc-chip.done { opacity: .55; }
.fc-chip.done .ct { text-decoration: line-through; }
.fc-chip.hold { opacity: .6; box-shadow: inset 0 0 0 1px var(--border-strong), inset 3px 0 0 var(--c); background: repeating-linear-gradient(135deg, var(--tint), var(--tint) 6px, #fff 6px, #fff 9px); }
.fc-chip.overdue { box-shadow: inset 0 0 0 1.5px var(--danger), inset 3px 0 0 var(--c); }
.fc-chip.overdue .ct { color: #9b1c12; font-weight: 700; }
.fc .fc-more-link { font-size: 12px; font-weight: 700; color: var(--primary); }
.fc .fc-popover { border-radius: 10px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.fc .fc-popover-header { background: var(--surface-2); padding: 7px 10px; font-weight: 700; border-radius: 10px 10px 0 0; }
.fc .fc-multimonth { border: 0; }
.fc .fc-multimonth-title { font-size: 15px; font-weight: 800; padding: 10px 4px 6px; }
.fc .fc-multimonth-daygrid { background: #fff; }
.fc .fc-multimonth .fc-daygrid-day-number { font-size: 11.5px; }
.fc .fc-multimonth .fc-daygrid-event { margin: 0 1px 1px !important; }
.fc .fc-multimonth .fc-chip { font-size: 10.5px; min-height: 16px; padding: 0 3px 0 5px; }
.fc .fc-multimonth .fc-chip .cp { display: none; }
.fc-theme-standard .fc-scrollgrid { border-radius: 8px; overflow: hidden; }
.fc .fc-daygrid-week-number { display: none; }
.fc .fc-highlight { background: rgba(47, 111, 237, .08); }
.fc .fc-event-mirror { opacity: .85; }
.fc .fc-list { border-radius: 8px; }
.fc .fc-daygrid-body-natural .fc-daygrid-day-events { margin-bottom: 4px; }
.cal-week .fc .fc-daygrid-day-frame { min-height: 360px; }
.cal-month .fc .fc-daygrid-day-frame { min-height: 108px; }

/* 일간·주간(모바일) 목록 */
.agenda-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.agenda-day-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 800; }
.agenda-day-head.today { background: var(--primary-50); color: var(--primary-600); }
.agenda-day-head.sun, .agenda-day-head.hol { color: var(--sun); }
.agenda-day-head .hol-name { font-size: 12px; font-weight: 600; margin-left: 6px; }
.agenda-day .item-row { padding: 9px 12px; }
.agenda-sec { padding: 4px 12px 8px; }
.agenda-sec h5 { margin: 10px 0 4px; font-size: 12px; color: var(--muted); font-weight: 800; }
.kind-ic { width: 22px; text-align: center; flex: none; font-size: 12px; font-weight: 800; color: var(--muted); }

/* 간트 */
.gantt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.gantt-scroll { overflow: auto; max-height: calc(100vh - 220px); position: relative; }
.gantt-grid { position: relative; }
.gantt-head { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; }
.gantt-label-col { position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--border); flex: none; }
.gantt-head .gantt-label-col { z-index: 5; display: flex; align-items: flex-end; padding: 6px 12px; font-size: 12px; color: var(--muted); font-weight: 700; }
.gantt-months { position: relative; height: 26px; border-bottom: 1px solid var(--border); }
.gantt-days { position: relative; height: 22px; }
.gantt-month { position: absolute; top: 0; height: 26px; border-left: 1px solid var(--border); padding: 4px 6px; font-size: 12px; font-weight: 800; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.gantt-day { position: absolute; top: 0; height: 22px; font-size: 10.5px; text-align: center; color: var(--faint); line-height: 22px; }
.gantt-day.sun, .gantt-day.hol { color: var(--sun); }
.gantt-row { display: flex; border-bottom: 1px solid #f0f2f5; min-height: 34px; }
.gantt-row.project { background: #fcfcfd; }
.gantt-row .gantt-label-col { display: flex; align-items: center; gap: 6px; padding: 0 10px; font-size: 13px; min-width: 0; }
.gantt-row .gantt-label-col .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.gantt-row.task .gantt-label-col { padding-left: 30px; font-weight: 500; color: var(--text-2); font-size: 12.5px; }
.gantt-track { position: relative; flex: none; }
.gantt-bar { position: absolute; top: 7px; height: 20px; border-radius: 6px; background: var(--tint); box-shadow: inset 0 0 0 1.5px var(--c); font-size: 11.5px; font-weight: 700; padding: 0 7px; line-height: 20px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; color: var(--text); }
.gantt-bar.project { background: var(--c); color: #fff; box-shadow: none; top: 8px; height: 18px; line-height: 18px; opacity: .92; }
.gantt-bar.done { opacity: .5; }
.gantt-bar.overdue { box-shadow: inset 0 0 0 1.5px var(--danger); }
.gantt-ms { position: absolute; top: 9px; width: 14px; height: 14px; transform: rotate(45deg); background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--c); cursor: pointer; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); opacity: .55; z-index: 2; pointer-events: none; }
.gantt-weekend { position: absolute; top: 0; bottom: 0; background: #f7f8fa; pointer-events: none; }
.gantt-caret { border: 0; background: none; width: 20px; height: 20px; padding: 0; color: var(--muted); flex: none; }

/* 업무량 */
.wl-table td.cell { text-align: center; font-weight: 700; min-width: 44px; cursor: pointer; border-left: 1px solid #f0f2f5; }
.wl-table td.cell.z { color: var(--faint); font-weight: 500; }
.wl-table th.day { text-align: center; min-width: 44px; }
.wl-table th.day.sun, .wl-table th.day.hol { color: var(--sun); }
.wl-table th.day.today { background: var(--primary-50); color: var(--primary-600); }
.wl-table td.cell.over { background: var(--danger-50) !important; color: var(--danger); }
.wl-table td.cell.sel { outline: 2px solid var(--primary); outline-offset: -2px; }

/* 발주 단계 보드 */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.board-col { background: var(--surface-3); border-radius: var(--radius); padding: 10px; min-height: 160px; }
.board-col h4 { margin: 0 0 8px; font-size: 13px; font-weight: 800; display: flex; justify-content: space-between; }
.board-card { background: var(--surface); border-radius: 9px; padding: 9px 10px; margin-bottom: 8px; box-shadow: var(--shadow), inset 3px 0 0 var(--c); cursor: pointer; font-size: 13px; }
.board-card .t { font-weight: 700; }

/* 하단 탭바·추가 버튼 (모바일) */
.mobile-tabbar { display: none; }
.fab { display: none; }

/* 로그인 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(1200px 600px at 20% -10%, #e8efff 0, transparent 60%), radial-gradient(900px 500px at 120% 110%, #fff1e6 0, transparent 55%), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 30px 28px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--text); display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 9px; }
.login-logo span { border-radius: 3px; }
.login-logo span:nth-child(1) { background: #f08c4a; }
.login-logo span:nth-child(2) { background: #59c27a; }
.login-logo span:nth-child(3) { background: #5b9cf0; grid-column: span 2; }
.login-company { font-size: 13px; color: var(--muted); font-weight: 700; }
.login-card h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.login-card .field input { height: 44px; font-size: 15px; }
.login-card .btn { height: 46px; font-size: 15px; margin-top: 8px; }
.login-help { text-align: center; color: var(--muted); font-size: 13px; margin: 16px 0 0; }
.alert { border-radius: 9px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }
.alert-error { background: var(--danger-50); color: #9b1c12; border: 1px solid #f6cdc9; }
.alert-info { background: var(--primary-50); color: var(--primary-600); border: 1px solid #cddcff; }
.alert-warn { background: var(--warn-50); color: #8a4405; border: 1px solid #f8dcb4; }

/* 가져오기 */
.import-drop { border: 2px dashed var(--border-strong); border-radius: 14px; padding: 36px 20px; text-align: center; background: var(--surface); cursor: pointer; }
.import-drop:hover, .import-drop.over { border-color: var(--primary); background: var(--primary-50); }

/* ---------- 반응형 ---------- */
@media (max-width: 1200px) {
  .header-search { width: 160px; }
  .span-4, .span-5 { grid-column: span 6; }
  .span-7, .span-8 { grid-column: span 12; }
}
@media (max-width: 1024px) {
  .app-nav a .nav-text-long { display: none; }
  .cal-layout { grid-template-columns: 1fr; }
  .cal-side { display: none; position: fixed; inset: var(--header-h) auto 0 0; width: 290px; z-index: 70; max-height: none; box-shadow: var(--shadow-lg); }
  .cal-side.open { display: block; }
  .cal-filter-btn { display: inline-flex !important; }
  .header-search { display: none; }
}
@media (max-width: 768px) {
  :root { --header-h: 52px; }
  body { font-size: 15px; }
  .app-header { padding: 0 10px 0 12px; gap: 8px; }
  .app-nav { display: none; }
  .brand-company { font-size: 10.5px; }
  .brand-app { font-size: 14px; }
  .header-right { margin-left: auto; }
  .app-main { padding: 14px 12px 96px; }
  .app-main.wide { padding-bottom: 80px; }
  .page-title { font-size: 19px; }
  .dash-grid { display: flex; flex-direction: column; gap: 12px; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .cal-main { padding: 10px 10px 20px; }
  .cal-title { font-size: 17px; margin: 0; }
  .cal-toolbar { gap: 6px; }
  .cal-toolbar .seg button { padding: 0 8px; }
  .cal-body.with-tray { grid-template-columns: 1fr; }
  .cal-card { padding: 4px; }
  .cal-month .fc .fc-daygrid-day-frame { min-height: 74px; }
  .fc { font-size: 11.5px; }
  .fc-chip { font-size: 10.5px; padding: 1px 3px 1px 5px; min-height: 17px; }
  .fc-chip .cp { display: none; }
  .fc .day-hol, .fc .day-season { display: none; }
  .drawer { width: 100vw; }
  .drawer-body { padding: 14px; }
  .kv { grid-template-columns: 1fr; gap: 4px 0; }
  .kv > .k { margin-top: 8px; }
  .kv > .k.top { padding-top: 0; }
  .modal-wrap { padding: 0; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; overflow-y: auto; }
  .modal-foot { border-radius: 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .table-wrap { border-radius: 10px; }
  .table th, .table td { padding: 8px; }
  .hide-mobile { display: none !important; }
  .filters select, .filters input { flex: 1 1 140px; }
  input[type=text], input[type=password], input[type=date], input[type=month], input[type=time], input[type=number], input[type=email], input[type=url], input[type=search], input[type=tel], select, textarea { font-size: 16px; height: 42px; }
  textarea { height: auto; }
  .alerts-panel { position: fixed; top: var(--header-h); left: 8px; right: 8px; width: auto; }
  .mobile-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--border); padding: 4px 4px max(4px, env(safe-area-inset-bottom)); }
  .mobile-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 0 3px; font-size: 11px; font-weight: 700; color: var(--muted); }
  .mobile-tabbar a.on { color: var(--primary); }
  .mobile-tabbar a:hover { text-decoration: none; }
  .mobile-tabbar .ico { width: 22px; height: 22px; }
  .fab { display: flex; position: fixed; right: 16px; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 55; width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(47, 111, 237, .4); }
  .fab .ico { width: 26px; height: 26px; }
  .toast-stack { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .gantt-scroll { max-height: none; }
}
@media (min-width: 769px) {
  .show-mobile { display: none !important; }
}
@media print {
  .app-header, .mobile-tabbar, .fab, .cal-side, .cal-toolbar, .drawer, .drawer-backdrop, .toast-stack { display: none !important; }
  .cal-layout { display: block; }
}

/* ---------- 목록 화면 보조 ---------- */
.sel-row { display: flex; align-items: center; gap: 6px; }
.sel-row > input[type=checkbox] { flex: none; margin-left: 2px; }
.sel-row > .item-row { flex: 1; min-width: 0; }
.bulk-bar { position: sticky; top: calc(var(--header-h) + 8px); z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 12px; margin-bottom: 14px; background: #1c2433; color: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); }
.bulk-bar button, .bulk-bar select { height: 32px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .14); color: #fff; padding: 0 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; width: auto; }
.bulk-bar select option { color: var(--text); }
.bulk-bar button:hover { background: rgba(255, 255, 255, .24); }
.bulk-bar button:disabled { opacity: .5; }
.stage-select { width: auto; min-width: 118px; height: 30px; font-size: 12.5px; font-weight: 700; color: var(--primary-600); background-color: var(--primary-50); border-color: transparent; }
.stage-select.late { color: var(--danger); background-color: var(--danger-50); }
.stage-select.fin { color: var(--ok); background-color: var(--ok-50); }
.table tfoot td { border-top: 2px solid var(--border-strong); background: var(--surface-2); }

/* ---------- 출력 고르기 ---------- */
.print-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.print-type { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; text-align: left; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.print-type .ico { width: 22px; height: 22px; color: var(--muted); }
.print-type small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.print-type:hover { border-color: var(--border-strong); }
.print-type.on { border-color: var(--primary); background: var(--primary-50); }
.print-type.on .ico { color: var(--primary); }

/* ---------- 더보기 메뉴 ---------- */
.more-menu { display: flex; flex-direction: column; padding: 6px; }
.more-menu a { display: flex; align-items: center; gap: 12px; padding: 13px 12px; border-radius: 9px; color: var(--text); font-weight: 600; font-size: 15px; }
.more-menu a:hover { background: var(--surface-3); text-decoration: none; }
.more-menu a .ico { color: var(--muted); }

/* ---------- 엑셀 가져오기 ---------- */
.import-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.import-steps span { padding: 6px 12px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-weight: 700; font-size: 13px; }
.import-steps span.on { background: var(--primary); color: #fff; }
.import-steps span.done { background: var(--primary-50); color: var(--primary-600); }
.import-table td { vertical-align: top; }
.import-table tr.off td { opacity: .45; }
.import-note { color: var(--muted); font-size: 12.5px; }

.app-header .icon-btn.search-only { display: none; }
@media (max-width: 1024px) {
  .app-header .icon-btn.search-only { display: inline-flex; }
}
@media (max-width: 768px) {
  .bulk-bar { top: calc(var(--header-h) + 4px); }
  .print-types { grid-template-columns: 1fr 1fr; }
}

/* ---------- 다듬기 ---------- */
.filters input[type=checkbox], .filters input[type=radio] { min-width: 0; width: auto; height: auto; flex: none; }
.filters .check { margin: 0 6px 0 2px; white-space: nowrap; }
.filters-toggle { display: none; }
.cal-week .fc-chip { display: block; white-space: normal; text-align: left; line-height: 1.4; padding-top: 3px; padding-bottom: 3px; }
.cal-week .fc-chip > * { display: inline; margin-right: 4px; }
.cal-week .fc-chip .ct { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; margin-right: 0; }
.cal-week .fc-chip .cp { max-width: none; overflow: visible; }
.fc .fc-multimonth .day-hol, .fc .fc-multimonth .day-season { display: none; }
.wl-table th.day.sat { color: var(--sat); }
.kind-ic .ico { width: 15px; height: 15px; vertical-align: -3px; }
@media (max-width: 768px) {
  .filters-toggle { display: inline-flex; }
  .filters.collapsed > :not(.filters-keep) { display: none !important; }
  .filters .filters-keep[type=search] { flex: 1 1 160px; }
}

/* ---------- 프로젝트 템플릿 ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.tpl-card { display: flex; flex-direction: column; overflow: hidden; border-top: 4px solid var(--c); }
.tpl-card-main { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 12px; cursor: pointer; }
.tpl-card-main:hover .tpl-name { color: var(--primary); }
.tpl-dot { width: 10px; height: 10px; flex: none; border-radius: 3px; background: var(--c); }
.tpl-name { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.tpl-desc { margin: 0; min-height: 40px; color: var(--text-2); font-size: 13px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 12px; color: var(--muted); }
.tpl-card-foot { display: flex; gap: 8px; padding: 10px 18px 14px; border-top: 1px solid var(--surface-3); }

/* D-day 타임라인 */
.tl { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tl-inner { position: relative; }
.tl-axis { display: flex; height: 36px; }
.tl-gutter { width: 58px; flex: none; padding-top: 8px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.tl-axis-track { position: relative; flex: 1; }
.tl-tick { position: absolute; top: 2px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; line-height: 1.25; white-space: nowrap; }
.tl-tick b { font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-tick small { font-size: 10.5px; color: var(--faint); }
.tl-tick.zero b { color: var(--c); font-weight: 800; font-size: 12px; }
.tl-tick.zero small { color: var(--c); }
.tl-body { position: relative; border-top: 1px solid var(--border); }
.tl-overlay { position: absolute; top: 0; bottom: 0; left: 58px; right: 0; pointer-events: none; }
.tl-grid { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--border); }
.tl-off { position: absolute; top: 0; bottom: 0; background: rgba(103, 113, 137, .08); }
.tl-anchor { position: absolute; top: -4px; bottom: 0; width: 2px; margin-left: -1px; background: var(--c); border-radius: 2px; }
.tl-lane { position: relative; display: flex; }
.tl-lane + .tl-lane { border-top: 1px solid var(--surface-3); }
.tl-track { position: relative; flex: 1; }
.tl-bar { position: absolute; height: 6px; margin-top: -3px; border-radius: 3px; background: #c9d1e0; }
.tl-bar.k-event { height: 14px; margin-top: -7px; border-radius: 4px; background: color-mix(in srgb, var(--c) 18%, white); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 55%, white); }
.tl-bar.k-po { height: 0; margin-top: 0; border-radius: 0; background: none; border-top: 2px dashed #e0a15a; }
.tl-bar.k-po::before { content: ""; position: absolute; left: -1px; top: -6px; width: 2px; height: 10px; background: #c4600a; border-radius: 1px; }
.tl-bar.on { filter: saturate(1.4) brightness(.92); }
.tl-head { position: absolute; display: inline-flex; align-items: center; gap: 5px; height: 18px; padding: 0 4px 0 0; margin-left: -5px; border: 0; border-radius: 4px; background: none; font-size: 12px; line-height: 18px; color: var(--text); white-space: nowrap; z-index: 1; }
.tl-head i { width: 10px; height: 10px; flex: none; border-radius: 50%; background: #5b6b8c; box-shadow: 0 0 0 2px var(--surface); }
.tl-head span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.tl-head.k-milestone i { width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); background: var(--c); }
.tl-head.k-goal i { width: 11px; height: 11px; background: var(--c); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--c); }
.tl-head.k-goal span { font-weight: 700; }
.tl-head.k-po i { border-radius: 2px; background: #c4600a; }
.tl-head.flip { flex-direction: row-reverse; transform: translateX(-100%); margin-left: 5px; padding: 0 0 0 4px; }
.tl-head.k-event { margin-left: 4px; }
.tl-head.k-event.flip { margin-left: -4px; }
.tl-head.k-event i { display: none; }
.tl-head:hover span, .tl-head.on span { color: var(--primary); }
.tl-head.on span { font-weight: 700; }
.tl-head.on i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
.tl-head:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.tl.mini { overflow: hidden; border-radius: 8px; background: var(--surface-2); }
.tl.mini .tl-body { border-top: 0; }
.tl.mini .tl-overlay { left: 0; }
.tl.mini .tl-head { margin-left: -4px; height: 14px; cursor: default; }
.tl.mini .tl-head i { width: 8px; height: 8px; }
.tl.mini .tl-head.k-goal i { width: 9px; height: 9px; }
.tl.mini .tl-head.k-event i { display: block; width: 6px; height: 6px; background: var(--c); }
.tl.mini .tl-bar { height: 4px; margin-top: -2px; }
.tl.mini .tl-bar.k-event { height: 8px; margin-top: -4px; }
.tl.mini .tl-bar.k-po { height: 0; margin-top: 0; border-top-width: 1.5px; }
.tl.mini .tl-bar.k-po::before { display: none; }

/* 템플릿 편집 */
input[type=text].tpl-name-input { display: block; width: 100%; height: auto; margin-top: 2px; padding: 2px 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
input[type=text].tpl-name-input:focus { box-shadow: none; border-bottom-color: var(--c); }
.tpl-items { padding: 2px 0 10px; }
.tpl-row { display: grid; grid-template-columns: 100px minmax(170px, 1fr) 200px 104px 112px 118px 112px 62px; gap: 8px; align-items: start; padding: 8px 16px; border-top: 1px solid var(--surface-3); }
.tpl-row-head { padding-top: 2px; padding-bottom: 6px; border-top: 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.tpl-row.on { background: var(--primary-50); }
.tpl-row.flash { animation: tpl-flash 1.4s ease; }
@keyframes tpl-flash { 0%, 30% { background: #fff1bf; } 100% { background: var(--primary-50); } }
.tpl-row .faint { display: inline-block; padding-top: 6px; }
.tpl-row .c-off, .tpl-row .c-span, .tpl-row .c-lead { display: flex; align-items: center; gap: 4px; }
.tpl-row .c-off input { width: 58px; }
.tpl-row .c-off select { width: 82px; }
.tpl-row .c-span input, .tpl-row .c-lead input { width: 56px; }
.tpl-dd { min-width: 44px; text-align: right; font-size: 11.5px; font-weight: 800; color: var(--c); font-variant-numeric: tabular-nums; }
.tpl-row .c-acts { display: flex; justify-content: flex-end; gap: 2px; }
.tpl-row .c-acts .icon-btn.on { color: var(--primary); }
.tpl-when { margin-top: 4px; font-size: 12px; color: var(--text-2); }
.tpl-when.past { color: var(--danger); }
.tpl-more { grid-column: 2 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 2px; }
.tpl-more .field { margin: 0; }
.tpl-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px 4px; border-top: 1px solid var(--surface-3); }
.card-head.wrap { flex-wrap: wrap; gap: 8px 12px; }
.save-bar { position: sticky; bottom: 16px; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 460px; margin: 0 auto; padding: 9px 10px 9px 16px; border-radius: 12px; background: #1c2433; color: #fff; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); }

/* 템플릿으로 시작 */
.tpl-choose { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.tpl-option { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; text-align: left; border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: 10px; background: var(--surface); }
.tpl-option:hover { background: var(--surface-2); border-color: var(--border-strong); border-left-color: var(--c); }
.tpl-option small { line-height: 1.45; }
.tpl-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 14px; }
.tpl-role { display: flex; align-items: center; gap: 8px; }
.tpl-role > span { min-width: 66px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.tpl-preview { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--border); }
.tpl-plan { list-style: none; max-height: 42vh; margin: 8px 0 0; padding: 0; overflow: auto; border: 1px solid var(--surface-3); border-radius: 9px; }
.tpl-plan li { padding: 7px 10px; border-top: 1px solid var(--surface-3); font-size: 13px; }
.tpl-plan li:first-child { border-top: 0; }
.tpl-plan li.off { opacity: .45; }
.tpl-plan li.off .grow { text-decoration: line-through; }
.tpl-plan li.past .tpl-plan-date { color: var(--danger); }
.tpl-plan-date { width: 172px; flex: none; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tpl-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 13px; }

@media (max-width: 1180px) {
  .tpl-row { display: flex; flex-wrap: wrap; gap: 6px 8px; }
  .tpl-row-head { display: none; }
  .tpl-row > .na { display: none; }
  .tpl-row .c-kind { order: 1; width: 100px; flex: none; }
  .tpl-row .c-title { order: 2; flex: 1 1 0; min-width: 150px; }
  .tpl-row .c-off, .tpl-row .c-span, .tpl-row .c-cat, .tpl-row .c-role, .tpl-row .c-lead { order: 3; }
  .tpl-row .c-acts { order: 4; margin-left: auto; }
  .tpl-row .c-cat select { width: 118px; }
  .tpl-row .c-role input { width: 118px; }
  .tpl-more { order: 5; flex: 1 1 100%; grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .tpl-grid { grid-template-columns: 1fr; }
  .tpl-plan-date { width: 112px; }
  .tpl-row { padding: 10px 12px; }
  .save-bar { bottom: calc(76px + env(safe-area-inset-bottom)); }
  input[type=text].tpl-name-input { font-size: 20px; height: auto; }
  .tl-gutter { width: 44px; font-size: 11px; }
  .tl-overlay { left: 44px; }
}
@media (max-width: 768px) {
  /* 휴대폰: 작은 입력칸도 글자 16px (누를 때 화면이 확대되지 않게) */
  input.sm, select.sm { height: 40px; font-size: 16px; }
}

/* ---------- 발주 단계 보드 ---------- */
.po-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(228px, 1fr); gap: 10px; align-items: start; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; }
.po-col { display: flex; flex-direction: column; min-height: 260px; border-radius: 12px; background: var(--surface-3); scroll-snap-align: start; transition: background .12s, box-shadow .12s; }
.po-col.ordered { background: #e9eef7; }
.po-col.done { background: #e8f4ee; }
.po-col.over { background: var(--primary-50); box-shadow: inset 0 0 0 2px var(--primary); }
.po-col-head { padding: 10px 12px 8px; }
.po-col-head h4 { margin: 0; font-size: 13.5px; font-weight: 800; white-space: nowrap; }
.po-col-no { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: none; border-radius: 6px; background: var(--surface); font-size: 11px; font-weight: 800; color: var(--muted); }
.po-col-count { margin-left: auto; padding: 0 8px; border-radius: 999px; background: var(--surface); font-size: 12px; font-weight: 800; color: var(--text-2); }
.po-col-sum { min-height: 17px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.po-col-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 0 8px 10px; }
.po-card { padding: 9px 8px 7px 12px; border-radius: 9px; background: var(--surface); box-shadow: var(--shadow), inset 3px 0 0 var(--c); font-size: 13px; cursor: grab; }
.po-card:hover { box-shadow: 0 4px 14px rgba(16, 24, 40, .12), inset 3px 0 0 var(--c); }
.po-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.po-card.late { box-shadow: var(--shadow), inset 3px 0 0 var(--c), inset 0 0 0 1px #f0b4ae; }
.po-card.drag { opacity: .4; }
.po-card.busy { opacity: .65; }
.po-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 20px; }
.po-card-title { margin: 4px 0 2px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.po-card-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-2); }
.po-card-meta > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-card-foot { display: flex; align-items: center; gap: 4px; min-height: 28px; margin-top: 4px; }
.po-date { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.po-date.over { color: var(--danger); font-weight: 800; }
.po-card { position: relative; }
.po-card-move { position: absolute; right: 6px; bottom: 6px; display: inline-flex; visibility: hidden; border-radius: 7px; background: var(--surface); box-shadow: 0 0 0 1px var(--border), 0 2px 6px rgba(16, 24, 40, .08); }
.po-card:hover .po-card-move, .po-card:focus-within .po-card-move { visibility: visible; }
.po-col-empty { padding: 14px 8px; border: 1.5px dashed var(--border-strong); border-radius: 9px; text-align: center; font-size: 12px; color: var(--faint); }
.po-board.dragging .po-col-empty { border-color: var(--primary); color: var(--primary); }
@media (hover: none), (max-width: 768px) {
  .po-card-move { position: static; visibility: visible; box-shadow: none; }
}
@media (max-width: 768px) {
  .po-board { grid-auto-columns: 80vw; scroll-snap-type: x mandatory; }
}
.po-date { white-space: nowrap; }
.po-dday { margin-left: 5px; font-weight: 800; }

/* ---------- 견적서 ---------- */
.est-status { width: auto; min-width: 96px; height: 34px; font-weight: 700; color: var(--text-2); background-color: var(--surface-3); border-color: transparent; }
.est-status.sm { height: 30px; min-width: 88px; font-size: 12.5px; }
.est-status.st-sent { color: var(--primary-600); background-color: var(--primary-50); }
.est-status.st-accepted { color: var(--ok); background-color: var(--ok-50); }
.est-status.st-declined { color: #8a93a6; background-color: #f2f4f7; }
.est-table td { vertical-align: middle; }

.est-edit { position: relative; }
.est-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 14px; }
input[type=text].est-title-input { flex: 1 1 320px; min-width: 0; height: auto; margin-top: 2px; padding: 2px 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
input[type=text].est-title-input:focus { box-shadow: none; border-bottom-color: var(--primary); }
.est-tabs { display: none; margin-bottom: 12px; }
.est-cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(340px, .7fr); gap: 20px; align-items: start; }
.est-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.est-form > .card { margin: 0; }
.est-h { margin: 0 0 12px; font-size: 15px; font-weight: 800; }
.est-h small { font-weight: 500; font-size: 12px; }
.est-staff { display: grid; grid-template-columns: 1fr .8fr 1.2fr 1.4fr; gap: 8px; margin-top: 6px; }
.est-meta { padding: 0 4px 20px; }

/* 항목 편집 */
.est-items-card { overflow: visible; }
.ei-head, .ei-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 54px 50px 96px 110px 100px; gap: 6px; align-items: start; }
.ei-head { padding: 8px 14px 6px; font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--border); }
.ei-head span:nth-child(n+3):nth-child(-n+6) { text-align: right; padding-right: 8px; }
.ei-list { padding: 4px 0; }
.ei-row { padding: 6px 14px; border-bottom: 1px solid var(--surface-3); }
.ei-row input[type=text], .ei-row select { height: 34px; font-size: 13.5px; }
.ei-row .ei-qty, .ei-row .ei-price, .ei-row .ei-amt { text-align: right; font-variant-numeric: tabular-nums; }
.ei-row .ei-qty, .ei-row .ei-unit, .ei-row .ei-price, .ei-row .ei-amt { padding: 0 8px; }
.ei-row .ei-unit::-webkit-calendar-picker-indicator { display: none !important; }
.ei-no { padding-top: 8px; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; text-align: center; }
.ei-no.g { padding-top: 4px; font-size: 18px; font-weight: 700; color: var(--text); font-family: Georgia, "Times New Roman", serif; }
.ei-row.k-group { background: var(--surface-2); border-top: 1px solid var(--border); }
.ei-row.k-group .ei-title { font-weight: 800; }
.ei-row.k-group.excluded { background: var(--warn-50); }
.ei-row.k-text .ei-title { color: var(--text-2); font-size: 13px; border-style: dashed; }
.ei-span3 { grid-column: span 3; }
.ei-span4 { grid-column: span 4; }
.ei-sub { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ei-po { border: 0; cursor: pointer; }
.ei-acts { display: flex; justify-content: flex-end; gap: 0; padding-top: 3px; }
.ei-acts .icon-btn.sm { width: 26px; height: 26px; }
.ei-acts .icon-btn.on { color: var(--primary); }
.ei-acts .icon-btn:disabled { opacity: .3; }
.ei-more { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 6px; padding: 6px 0 4px; }
.ei-more .field { margin: 0; }
.ei-more textarea { min-height: 54px; }
.ei-more-row { display: grid; grid-template-columns: 1.4fr 1fr 110px; gap: 8px; }
.ei-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; }

.est-sum { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; }
.est-sum > div { display: flex; justify-content: space-between; padding: 2px 0; }
.est-sum > div span { color: var(--text-2); }
.est-sum .grand { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 16px; }
.est-sum .grand span { color: var(--text); font-weight: 700; }
.est-sum .words { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; text-align: right; }
.est-sum.compact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 8px; }
.est-sum.compact > div { flex-direction: column; }
.est-sum.compact b { font-size: 16px; }
.est-pay { display: grid; grid-template-columns: 1fr 96px 1.3fr 120px 28px; gap: 8px; align-items: center; margin-top: 6px; }
.est-pay b { text-align: right; font-size: 13px; }
.est-internal { border: 1px dashed #e0c9a6; background: #fffaf2; }

/* 미리보기 */
.est-preview { position: sticky; top: calc(var(--header-h) + 12px); display: flex; flex-direction: column; max-height: calc(100vh - var(--header-h) - 24px); border-radius: 14px; background: #e2dfda; overflow: hidden; }
.est-preview-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 13px; background: #d8d4ce; }
.est-preview-head .seg button { height: 26px; font-size: 12px; padding: 0 9px; }
.est-preview-head .seg + .seg { margin-left: 4px; }
.est-pane { flex: 1; overflow: auto; padding: 14px; }
.est-frame-wrap { position: relative; width: 100%; }
.est-frame { position: absolute; top: 0; left: 0; width: 794px; border: 0; background: transparent; transform-origin: 0 0; opacity: 0; pointer-events: none; }
.est-frame.on { opacity: 1; }

/* 설정 › 견적서 */
.est-bank { display: grid; grid-template-columns: 64px 1fr 1.4fr 1.2fr 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.est-seal-row { display: flex; gap: 20px; align-items: flex-start; }
.est-seal-box { position: relative; display: flex; align-items: center; justify-content: center; width: 220px; height: 110px; flex: none; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.est-seal-box::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: 30px; border-bottom: 1px solid #1c2433; }
.est-seal-box img { max-width: 84px; max-height: 84px; object-fit: contain; z-index: 1; }
.est-sig-sample { position: relative; z-index: 1; margin-bottom: 18px; font-family: "Ms Madi", cursive; font-size: 30px; color: #1f2a44; transform: rotate(-4deg); white-space: nowrap; }

@media (max-width: 1280px) {
  .est-cols { grid-template-columns: 1fr; }
  .est-tabs { display: inline-flex; }
  .est-edit.tab-edit .est-preview { display: none; }
  .est-edit.tab-preview .est-form { display: none; }
  .est-preview { position: static; max-height: none; }
}
@media (max-width: 900px) {
  .ei-head { display: none; }
  .ei-row { grid-template-columns: 30px 64px 56px minmax(0, 1fr) minmax(0, 1fr); row-gap: 6px; padding: 10px 12px; }
  .ei-row .ei-no { grid-column: 1; grid-row: 1; }
  .ei-row .ei-main { grid-column: 2 / -1; grid-row: 1; }
  .ei-row .ei-qty { grid-column: 2; grid-row: 2; }
  .ei-row .ei-unit { grid-column: 3; grid-row: 2; }
  .ei-row .ei-price { grid-column: 4; grid-row: 2; }
  .ei-row .ei-amt { grid-column: 5; grid-row: 2; }
  .ei-row.k-group .ei-amt { grid-column: 4 / -1; }
  .ei-row .ei-acts { grid-column: 2 / -1; grid-row: 3; }
  .ei-row.k-text .ei-acts { grid-row: 2; }
  .ei-span3, .ei-span4 { display: none; }
  .ei-more { grid-column: 1 / -1; grid-row: 4; }
  .ei-row input[type=text] { height: 40px; font-size: 16px; }
  .ei-more-row { grid-template-columns: 1fr; }
  .est-staff { grid-template-columns: 1fr 1fr; }
  .est-pay { grid-template-columns: 1fr 88px; }
  .est-pay > input:nth-of-type(2) { grid-column: 1 / -1; }
  .est-bank { grid-template-columns: 1fr 1fr; }
  .est-bank .check { grid-column: 1 / -1; }
  .est-seal-row { flex-direction: column; }
}

/* ---------- 발주서 ---------- */
.est-status.st-confirmed { color: var(--ok); background-color: var(--ok-50); }
.est-status.st-canceled { color: #8a93a6; background-color: #f2f4f7; }
a.pill.doc-pill { margin-left: 6px; text-decoration: none; vertical-align: 1px; }
a.pill.doc-pill:hover { box-shadow: inset 0 0 0 1px currentColor; }
.pd-filters select { width: auto; min-width: 150px; }
.pd-filters input[type=search] { width: 200px; }
.pd-flow { margin: -4px 0 14px; }
@media (min-width: 901px) {
  .pd-edit .ei-head, .pd-edit .ei-row { grid-template-columns: 34px minmax(0, 1fr) 72px 54px 96px 110px 100px; }
}
.ei-spec { margin-top: 5px; padding: 1px 2px; font-size: 12.5px; line-height: 1.5; color: var(--text-2); white-space: pre-line; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; cursor: pointer; border-radius: 4px; }
.ei-spec:hover { background: var(--surface-2); }
.ei-spec .ei-note { display: block; color: var(--muted); }
/* 발주서 만들기 창 */
.pdc-bar { gap: 10px 14px; align-items: flex-end; margin-bottom: 6px; }
.pdc-bar .field { flex: 1 1 200px; margin: 0; }
.pdc-check { margin-bottom: 9px; white-space: nowrap; }
.pdc-fixed { display: flex; align-items: center; height: 38px; font-size: 15px; }
.pdc-vendors { padding: 14px 0 4px; }
.pdc-vendors .chip b { margin-left: 2px; color: var(--primary); }
.pdc-group { margin-top: 16px; }
.pdc-group h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 14.5px; font-weight: 800; }
.pdc-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 2px 10px; align-items: start; padding: 9px 8px; border-radius: 9px; cursor: pointer; }
.pdc-row + .pdc-row { box-shadow: 0 -1px 0 var(--surface-3); }
.pdc-row:hover { background: var(--surface-2); }
.pdc-row.on { background: var(--primary-50); box-shadow: none; }
.pdc-row input[type=checkbox] { margin-top: 3px; }
.pdc-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 700; }
.pdc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.pdc-amt { padding-top: 1px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pdc-blank { margin-right: auto; }
.pdc-warn { align-self: center; }
.toast.warn { background: #93370d; }
@media (max-width: 768px) {
  .pd-filters { width: 100%; }
  .pd-filters select, .pd-filters input[type=search] { flex: 1 1 140px; width: auto; min-width: 0; }
  .pdc-bar .field { flex-basis: 100%; }
  .pdc-blank { padding: 0 8px; }
}

/* 머리글: 메뉴가 늘어 좁은 화면에서 줄여 보이기 */
@media (max-width: 1360px) {
  .header-search { display: none; }
  .app-header .icon-btn.search-only { display: inline-flex; }
}
@media (max-width: 1200px) and (min-width: 769px) {
  .app-nav a { padding: 0 8px; gap: 4px; }
  .app-nav a .ico { display: none; }
}
@media (max-width: 1000px) and (min-width: 769px) {
  .brand-text { display: none; }
}
