:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --side: #16202e;
  --side-2: #1e2b3c;
  --line: #e3e6ec;
  --text: #1d2530;
  --muted: #5f6877;   /* 흰 바탕 5.6:1 (AA). 예전 #7b8494 는 3.7:1 이었다 */
  --accent: #1f6feb;
  --accent-soft: #e8f0fe;
  --ok: #12805c;
  --ok-soft: #e3f5ee;
  --warn: #9a6b00;
  --warn-soft: #fdf3dc;
  --err: #c0362c;
  --err-soft: #fdeceb;
  --radius: 10px;
  /* 명함 로고 위 띠의 금색. 메일 서명(app/core/office.py 의 BRAND_GOLD)과 같은 값 */
  --gold: #fcbb16;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Malgun Gothic", "맑은 고딕", -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

.layout { display: flex; min-height: 100vh; }

/* ===== 사이드바 ===== */
.sidebar {
  width: 244px;
  flex: 0 0 244px;
  background: var(--side);
  color: #c9d3e0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
/* 안내메일 헤더와 같은 구성: 금색 띠 → 국문 사무소명 → 영문 사무소명 */
.brand {
  padding: 18px 18px 15px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-bar {
  display: block; width: 30px; height: 3px;
  background: var(--gold); border-radius: 1px;
}
.brand-ko {
  display: block; margin-top: 9px;
  color: #fff; font-size: 15.5px; font-weight: 700; letter-spacing: -.3px;
}
.brand-en {
  display: block; margin-top: 3px;
  color: var(--gold); font-size: 9.5px; font-weight: 700; letter-spacing: .3px;
}
.brand-app {
  display: block; margin-top: 7px;
  color: #7d8ba0; font-size: 9px; letter-spacing: 1.7px;
}

.menu { padding: 12px 10px; flex: 1; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; margin-bottom: 4px;
  background: none; border: 0; border-radius: 8px;
  color: #c9d3e0; font-size: 13.5px; font-family: inherit;
  cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--side-2); color: #fff; }
.menu-item.active { background: var(--accent); color: #fff; }
.menu-item.disabled { color: #6b7889; }
.menu-item.disabled.active { color: #fff; }  /* 준비중 탭도 선택되면 파란 바탕 위에서 읽히게 */
.menu-icon { font-size: 15px; }
.menu-icon img { width: 18px; height: 18px; display: block; }
.menu-label { flex: 1; }
.badge {
  font-size: 10px; padding: 2px 6px; border-radius: 20px;
  background: rgba(255,255,255,.1); color: #94a3b5;
}

.sidebar-foot {
  padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.07);
  font-size: 11.5px;
}
.stat-row { display: flex; justify-content: space-between; padding: 3px 0; color: #7d8ba0; }
.stat-row b { color: #d6dee9; font-weight: 500; }
.side-user {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.07);
}
.side-user > span { flex: 1 0 100%; color: #d6dee9; font-weight: 600; }
.side-user form { margin: 0; }
.link-btn {
  padding: 0; border: 0; background: none; font: inherit; font-size: 11.5px;
  color: #94a3b5; cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { color: #fff; }

/* ===== 로그인 ===== */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: var(--side); }
.login-box {
  width: 100%; max-width: 360px; padding: 28px 28px 22px;
  background: var(--panel); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.login-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; }
.login-brand strong { font-size: 15px; }
.login-brand span:last-child { font-size: 10.5px; letter-spacing: .14em; color: var(--muted); }
.login-brand .brand-bar { width: 4px; height: 18px; border-radius: 2px; background: var(--gold); }
.login-box h1 { margin: 0 0 4px; font-size: 20px; }
.login-sub { margin: 0 0 18px; color: var(--muted); font-size: 12.5px; }
.login-form, .pw-form { display: flex; flex-direction: column; gap: 12px; }
.login-form .btn { margin-top: 4px; padding: 10px 14px; }
.login-foot { margin: 16px 0 0; font-size: 12px; color: var(--muted); }
.login-out { margin-top: 12px; }
.f select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; font-family: inherit; background: #fcfcfd; color: var(--text);
}

/* ===== 본문 ===== */
.content { flex: 1; padding: 26px 30px 60px; max-width: 1680px; }
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 16px;
}
.page-head h1 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.2px; }
.sub { margin: 0; color: var(--muted); font-size: 12.5px; }
.head-actions { display: flex; gap: 8px; }

.notice {
  background: var(--accent-soft); border: 1px solid #cfe0fb;
  color: #274b82; border-radius: var(--radius);
  padding: 11px 14px; font-size: 12.5px; margin-bottom: 16px;
}

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; }
.card-title { margin: 0 0 14px; font-size: 15px; }
.card-head .card-title { margin-bottom: 14px; }
.count {
  display: inline-block; min-width: 20px; padding: 1px 7px; margin-left: 4px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 20px; font-size: 11.5px; font-weight: 600;
}

/* ===== 폼 ===== */
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 14px; }
.f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.f span { color: #4a5464; font-weight: 500; }
.f em { color: var(--muted); font-style: normal; font-weight: 400; }
.f em.req { color: var(--err); }
.f.wide { grid-column: span 2; }
.f.narrow { max-width: 160px; }
.f input {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; font-family: inherit; background: #fcfcfd; color: var(--text);
}
.f input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.form-actions {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 12px;
  padding-top: 4px;
}
.form-msg { font-size: 12.5px; }
.form-msg.err { color: var(--err); }
.form-msg.ok { color: var(--ok); }

/* ===== 버튼 ===== */
.btn {
  padding: 8px 14px; border-radius: 7px; border: 1px solid transparent;
  font-size: 13px; font-family: inherit; cursor: pointer;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #1a5fd0; }
.btn.ghost { background: #fff; border-color: var(--line); color: #3d4757; }
.btn.ghost:hover { background: #f3f5f8; }
.btn.sm { padding: 5px 8px; font-size: 12px; }
.btn.danger { color: var(--err); border-color: #f0cfcc; background: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn {
  background: none; border: 0; font-size: 16px; cursor: pointer; color: var(--muted);
}

/* ===== 표 ===== */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 600; font-size: 11.5px; color: var(--muted);
  padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 9px 8px; border-bottom: 1px solid #f0f2f5; vertical-align: top; }
.table tr.inactive td { opacity: .5; }
.table .right, .table th.right { text-align: right; }
.table .empty { text-align: center; color: var(--muted); padding: 28px 0; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 11.5px; }
.mono { font-family: Consolas, "D2Coding", monospace; font-size: 12px; }
.row-actions { display: inline-flex; gap: 4px; white-space: nowrap; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; background: #eef0f4; color: #4a5464;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.err { background: var(--err-soft); color: var(--err); }
.tag.info { background: var(--accent-soft); color: var(--accent); }

/* ===== 홈: 왼쪽 목록 + 오른쪽 상세 ===== */
.home-alert {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 14px;
  background: var(--err-soft); color: var(--err); border: 1px solid #f5cfcc; border-radius: var(--radius); font-size: 13px;
}
.link-btn.dark { color: var(--err); font-size: 12.5px; }
/* ---------------- 포워더 전용 탭 ---------------- */
.fw-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.fw-card { padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.fw-card span { display: block; font-size: 11.5px; color: var(--muted); }
.fw-card b { display: block; margin-top: 2px; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.fw-card em { display: block; font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.hd-box.fw-wide { margin-bottom: 16px; }
.fw-route { display: flex; margin: 4px 0 0; padding: 0; list-style: none; overflow-x: auto; }
.fw-route li { flex: 1 0 84px; position: relative; padding: 20px 6px 0 0; font-size: 12px; color: var(--muted); }
.fw-route li::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 3px; background: var(--line); }
.fw-route li::after { content: ""; position: absolute; top: 1px; left: 0; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 3px solid #c9d1dd; }
.fw-route li:last-child::before { right: auto; width: 13px; }
.fw-route li b { display: block; font-weight: 600; }
.fw-route li em { display: block; font-style: normal; font-variant-numeric: tabular-nums; }
.fw-route li span { display: block; font-size: 11px; }
.fw-route li.done { color: var(--text); }
.fw-route li.done::before, .fw-route li.done::after { background: var(--side); border-color: var(--side); }
.fw-route li.now { color: var(--text); }
.fw-route li.now::before { background: var(--line); }
.fw-route li.now::after { background: var(--gold); border-color: var(--gold); }
.fw-log { margin-top: 10px; font-size: 12.5px; }
.fw-log summary { cursor: pointer; color: var(--muted); }
.fw-log ul { margin: 6px 0 0; padding-left: 18px; max-height: 220px; overflow-y: auto; font-variant-numeric: tabular-nums; }
.fw-photo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; color: var(--muted); }
.fw-bulk { margin-bottom: 10px; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 12.5px; }
.fw-job { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; }
.fw-car { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfd; }
.fw-car.cur { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.fw-car h4 { margin: 0 0 6px; font-size: 13px; }
.fw-car h4 .mono { margin-left: 6px; font-weight: 400; color: var(--muted); }
.fw-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.fw-slot-name { display: block; margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.fw-slot-name i { font-style: normal; }
.fw-thumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; }
.fw-thumbs:empty { display: none; }
/* 상세 머리: 컨테이너 번호는 제목 크기로, 상태 표시는 제목의 글자 효과(유리 테마의 투명 글자)를 물려받지 않게 */
#fw-detail .hd-head h2 .mono { font-size: inherit; letter-spacing: 0; }
#fw-detail .hd-head h2 .tag { -webkit-text-fill-color: currentColor; vertical-align: middle; margin-left: 6px; font-size: 12px; letter-spacing: 0; }
.fw-thumb { width: 84px; height: 84px; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #eef1f5; cursor: zoom-in; }
.fw-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fw-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fw-shoot { display: grid; place-items: center; width: 84px; min-height: 84px; border: 1.5px dashed #b9c2d2; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; color: var(--accent); background: #fff; cursor: pointer; }
.fw-shoot:hover { border-color: var(--accent); background: var(--accent-soft); }
.fw-full { display: block; max-width: 100%; max-height: 72vh; margin: 0 auto; border-radius: 10px; }
.fw-full-act { margin: 10px 0 0; text-align: right; }
.fw-actions { margin-top: 10px; }
.fw-req { margin: 0; }
.fw-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; margin-top: 10px; align-items: end; }
.fw-form label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.fw-form label.wide { grid-column: 1 / -1; }
.fw-form input { padding: 7px 9px; border: 1px solid #c9d1dd; border-radius: 8px; font: inherit; font-size: 13px; color: var(--text); background: #fff; min-width: 0; }
.fw-form input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.fw-form .btn { justify-self: start; }
.fw-margin { margin: 10px 0 0; }
.fw-check { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--err-soft); color: var(--err); font-size: 13px; }
.fw-sched { margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f2f5; }
/* 서류 · 사진 상자: 끌어다 놓는 칸 셋 + 중량 비교 한 줄 */
.fw-weight { margin: 0 0 10px; padding: 9px 12px; border-radius: 10px; background: #f3f5f8; line-height: 1.7; }
.fw-weight.ok { background: var(--ok-soft); }
.fw-weight.err { background: var(--err-soft); }
.fw-drop { margin-top: 8px; padding: 10px 12px; border: 1.5px dashed #c9d1dd; border-radius: 10px; transition: border-color .12s, background .12s; }
.fw-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.fw-drop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fw-drop-hint { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.fw-docs { margin-top: 8px; }
.fw-docs li { align-items: center; }
.fw-docs a { color: var(--accent); overflow-wrap: anywhere; }
.fw-doc-kind { flex: none; padding: 4px 6px; border: 1px solid #c9d1dd; border-radius: 8px; font: inherit; font-size: 12px; background: #fff; color: var(--text); }
#page-forwarder .head-actions { flex-wrap: wrap; }          /* 버튼 넷이 휴대폰 한 줄에 안 들어간다 */
#fw-export { text-decoration: none; }
/* 부킹 넣기 · 고치기 창: 넓은 화면은 세 칸, 휴대폰은 두 칸 */
.fw-book h4 { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.fw-book h4:first-child { margin-top: 0; }
.fw-book .fw-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fw-book .fw-form label em { font-style: normal; color: var(--warn, #b45309); }
.fw-book .fw-form input:disabled { background: #f3f5f8; color: var(--muted); }
.fw-book .fw-actions { margin-top: 16px; }
@media (max-width: 640px) { .fw-book .fw-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  /* 좁은 화면에서는 경로를 세로로(가로로 밀어야 지금 단계가 보이던 것을 고침) */
  .fw-route { flex-direction: column; overflow: visible; }
  .fw-route li { flex: none; display: flex; flex-wrap: wrap; gap: 0 10px; align-items: baseline; padding: 0 0 12px 24px; font-size: 13px; }
  .fw-route li::before { top: 4px; bottom: -4px; left: 5px; right: auto; width: 3px; height: auto; }
  .fw-route li::after { top: 2px; }
  .fw-route li:last-child::before { display: none; }
  .fw-route li b { min-width: 96px; }
  .fw-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fw-thumb, .fw-shoot { width: 96px; height: 96px; min-height: 96px; }
  .fw-slots { grid-template-columns: 1fr; }
}
.home-note { margin-bottom: 12px; padding: 14px 18px; background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--gold); border-radius: var(--radius); font-size: 13px; }
.home-note-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.home-note h2 { margin: 0; font-size: 15px; }
.home-note ol { margin: 0; padding-left: 20px; line-height: 1.75; }
.home-note li b { margin-right: 4px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

.home-split { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 16px; align-items: start; }
.home-list {
  position: sticky; top: 16px; display: flex; flex-direction: column; max-height: calc(100vh - 32px);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.home-groups { display: flex; border-bottom: 1px solid var(--line); }
.home-group {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 2px 8px;
  background: none; border: 0; border-bottom: 3px solid transparent; font: inherit; color: var(--muted); cursor: pointer;
}
.home-group span { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.home-group b { font-size: 18px; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--text); }
.home-group:hover { color: var(--text); background: #f7f9fc; }
.home-group.on { color: var(--text); border-bottom-color: var(--gold); }
.home-group:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.home-tools { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #f0f2f5; }
.home-tools input[type=search] {
  flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid #c9d1dd; border-radius: 7px;
  font: inherit; font-size: 13px; background: #fff; color: var(--text);
}
.home-tools input[type=search]::placeholder { color: var(--muted); }
.home-tools input[type=search]:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.home-done { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.home-items { overflow-y: auto; flex: 1; }
.home-kind {
  margin: 0; padding: 12px 16px 4px; font-size: 12px; font-weight: 700; color: var(--muted);
}
.home-kind span { font-variant-numeric: tabular-nums; }
.home-item {
  display: block; width: 100%; padding: 10px 16px; text-align: left; cursor: pointer;
  background: none; border: 0; border-top: 1px solid #f0f2f5; font: inherit; color: var(--text);
}
.home-kind + .home-item { border-top: 0; }
.home-item:hover { background: #f7f9fc; }
.home-item.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--gold); }
.home-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hi-top { display: flex; align-items: center; gap: 8px; }
.hi-top b { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hi-top .tag { flex: none; font-weight: 600; }
.hi-sub {
  display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.home-empty { margin: 0; padding: 28px 18px; color: var(--muted); font-size: 13px; text-align: center; }

.home-detail { min-width: 0; }
.home-detail > .home-empty {
  padding: 80px 24px; background: var(--panel); border: 1px dashed #c9d1dd; border-radius: var(--radius);
}
.home-back { display: none; }
.hd-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.hd-head > div:first-child { flex: 1; min-width: 0; }
.hd-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.hd-head h2 .num { margin-left: 4px; font-size: 15px; font-weight: 600; color: var(--muted); }
.hd-head p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.hd-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.hd-tracks {
  display: grid; grid-template-columns: 4fr 3fr; gap: 28px; margin: 0 0 16px; padding: 14px 20px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.hd-track { min-width: 0; }
.hd-track-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.hd-track-head b { flex: none; }
.hd-track-head span { min-width: 0; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-steps { display: flex; margin: 0; padding: 0; list-style: none; }
.hd-steps li { flex: 1; position: relative; padding-top: 20px; font-size: 12.5px; color: var(--muted); }
.hd-steps li::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 3px; background: var(--line); }
.hd-steps li::after {
  content: ""; position: absolute; top: 1px; left: 0; width: 13px; height: 13px; border-radius: 50%;
  background: #fff; border: 3px solid #c9d1dd;
}
.hd-steps li:last-child::before { right: auto; width: 13px; }
.hd-steps li.done { color: var(--text); }
.hd-steps li.done::before, .hd-steps li.done::after { background: var(--side); border-color: var(--side); }
.hd-steps li.now { color: var(--text); font-weight: 700; }
.hd-steps li.now::after { background: var(--gold); border-color: var(--gold); }
.hd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hd-grid.one { grid-template-columns: minmax(0, 640px); }
.hd-box { padding: 14px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; }
.hd-box h3 { margin: 0 0 8px; font-size: 14px; }
.hd-rows { margin: 0; padding: 0; list-style: none; }
.hd-rows li { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-top: 1px solid #f0f2f5; }
.hd-rows li:first-child { border-top: 0; }
.hd-rows li > span:not(.tag) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hd-rows em { flex: none; font-style: normal; font-size: 12px; color: var(--muted); }
.hd-rows .tag { flex: none; }
.home-detail .late { color: var(--err); font-weight: 700; }
.hd-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.hd-kv dt { color: var(--muted); }
.hd-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.hd-path { font-size: 12px; }
.hd-folder { margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f2f5; }
.hd-memo { white-space: pre-wrap; }
.hd-none { margin: 0; color: var(--muted); }
.hd-err { margin: 0 0 8px; padding: 8px 10px; border-radius: 7px; background: var(--err-soft); color: var(--err); }
.hd-warn { margin: 10px 0 0; color: var(--warn); }

@media (max-width: 1180px) { .hd-grid { grid-template-columns: minmax(0, 1fr); } }
/* 좁은 화면: 목록만, 고르면 상세만 */
@media (max-width: 860px) {
  .home-split { display: block; }
  .home-list { position: static; max-height: none; }
  .home-split.show-detail .home-list, .home-split:not(.show-detail) .home-detail { display: none; }
  .home-back {
    display: inline-flex; align-items: center; gap: 4px; margin: 0 0 10px; padding: 6px 10px 6px 6px;
    background: #fff; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
  }
  .hd-head { flex-direction: column; gap: 10px; }
  .hd-act { justify-content: flex-start; }
  .hd-tracks { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 14px 14px 12px; }
  .hd-steps li { font-size: 11.5px; }
}
.kw { margin: 0 3px 3px 0; }

/* ===== 본문 2단 구성(좌: 목록 / 우: 추가·삭제 내역) ===== */
.page-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px; align-items: start;
}
.page-main { min-width: 0; }
.page-side { position: sticky; top: 26px; }
.side-card { max-height: calc(100vh - 60px); display: flex; flex-direction: column; }

.activity-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.activity-empty { color: var(--muted); font-size: 12.5px; padding: 18px 0; text-align: center; }
.activity-item { display: flex; gap: 9px; padding: 9px 2px; border-bottom: 1px solid #f2f4f7; }
.activity-item:last-child { border-bottom: 0; }
.act-icon {
  flex: 0 0 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: #eef0f4; color: #6b7686;
}
.activity-item.add .act-icon { background: var(--accent-soft); color: var(--accent); }
.activity-item.del .act-icon { background: var(--err-soft); color: var(--err); }
.activity-item.auto .act-icon { background: var(--ok-soft); color: var(--ok); }
.act-body { min-width: 0; }
.act-title { font-size: 12.5px; font-weight: 600; word-break: break-all; }
.act-kind {
  display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: 20px;
  font-size: 10px; font-weight: 600; background: #eef0f4; color: #6b7686; vertical-align: 1px;
}
.activity-item.add .act-kind { background: var(--accent-soft); color: var(--accent); }
.activity-item.del .act-kind { background: var(--err-soft); color: var(--err); }
.activity-item.auto .act-kind { background: var(--ok-soft); color: var(--ok); }
.act-detail { font-size: 11.5px; color: #5b6474; margin-top: 2px; }
.act-time { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ===== 요약 칩 ===== */
.summary-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 4px 10px; border-radius: 20px; font-size: 11.5px;
  background: #f1f3f6; color: #5b6474; border: 1px solid #e6e9ee;
}
.chip b { font-size: 12.5px; font-weight: 700; }
.chip.total { background: #1d2530; color: #fff; border-color: #1d2530; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: #cdeade; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: #f2e2b6; }
.chip.err { background: var(--err-soft); color: var(--err); border-color: #f5cfcc; }

/* ===== 표: 고정 폭 레이아웃 ===== */
.table.fixed { table-layout: fixed; }
.table.fixed .c-owner { width: 13%; }
.table.fixed .c-bl    { width: 16%; }
.table.fixed .c-mt    { width: 17.5%; }
.table.fixed .c-prgs  { width: 13%; }   /* 화물진행정보 */
.table.fixed .c-cscl  { width: 13%; }   /* 통관진행상태 - 동일 폭 */
.table.fixed .c-last  { width: 8.5%; }
.table.fixed .c-noti  { width: 12%; }
.table.fixed .c-act   { width: 7%; }

.table tbody tr:hover td { background: #fafbfd; }
.table tbody tr:hover td.hl { background: #f4f7fc; }
.table td { vertical-align: middle; }
.owner { font-weight: 600; font-size: 13px; word-break: break-all; }
.bl-no { font-weight: 600; word-break: break-all; }
.mt-no { color: #3d4757; word-break: break-all; }
.last-col { text-align: center; }
.last-col .cell-sub { font-variant-numeric: tabular-nums; }

/* ===== 진행상태 강조 ===== */
.table th.hl { color: #3d4757; }
.table td.hl { background: #fbfcfe; }
.pill {
  display: block; padding: 6px 7px; border-radius: 8px; text-align: center;
  font-size: 12px; font-weight: 700; line-height: 1.32; word-break: keep-all;
  letter-spacing: -.2px;
  background: #eef0f4; color: #4a5464; border: 1px solid transparent;
}
.pill.done { background: var(--ok-soft); color: #0d6b4d; border-color: #b8e3d1; }
.pill.work { background: var(--warn-soft); color: #8a5f00; border-color: #f0dcae; }
.pill.info { background: var(--accent-soft); color: #1a5fd0; border-color: #cfe0fb; }
.pill.wait { background: #f1f3f6; color: #6b7686; border-color: #e1e5eb; }
.pill.none { background: transparent; color: var(--muted); font-weight: 400; border: 0; }

.foot-note { margin: 12px 0 0; font-size: 11.5px; color: var(--muted); }

/* ===== 알림 토글 버튼 ===== */
.notify-cell { display: flex; flex-direction: column; gap: 4px; }
.btn.toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 3px;
  width: 100%; font-size: 11px; padding: 5px 6px; border-width: 1px;
  white-space: nowrap; line-height: 1.3;
}
.btn.toggle .sw-label { overflow: hidden; text-overflow: ellipsis; }
.btn.toggle.on {
  background: var(--accent-soft); color: var(--accent); border-color: #cfe0fb; font-weight: 600;
}
.btn.toggle.on:hover { background: #dbe8fd; }
.btn.toggle.off { background: #f4f5f7; color: #98a1af; border-color: var(--line); }
.btn.toggle.off:hover { background: #eceef2; color: #6b7686; }
.btn.toggle .sw {
  flex: 0 0 auto; padding: 1px 4px; border-radius: 20px;
  font-size: 9px; font-weight: 700; letter-spacing: .2px;
}
.btn.toggle.on .sw { background: var(--accent); color: #fff; }
.btn.toggle.off .sw { background: #d6dae1; color: #fff; }
.th-hint { font-weight: 400; color: #a8b0bc; font-size: 10.5px; margin-left: 3px; }

/* ===== 관리 버튼(상세 / 삭제) 세로 2행 ===== */
.row-actions {
  display: grid; grid-template-columns: 1fr; gap: 4px;
}
.row-actions .btn { padding: 4px 4px; font-size: 11.5px; }

@media (max-width: 1320px) {
  .page-grid { grid-template-columns: minmax(0, 1fr); }
  .page-side { position: static; }
  .side-card { max-height: 340px; }
}

/* ===== 다건 후보 ===== */
.candidates { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.candidates h3 { font-size: 13px; margin: 0 0 10px; color: var(--warn); }
.cand-list { display: flex; flex-direction: column; gap: 6px; }
.cand {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 12.5px;
}

/* ===== 준비중 ===== */
.placeholder { text-align: center; padding: 60px 20px; color: var(--muted); }
.ph-icon { font-size: 40px; margin-bottom: 10px; }
.placeholder h2 { margin: 0 0 8px; font-size: 17px; color: var(--text); }
.placeholder p { margin: 0 auto; max-width: 560px; font-size: 13px; }

/* ===== 상세 드로어 ===== */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(15,22,32,.35); z-index: 20;
}
.drawer {
  position: fixed; top: 0; right: 0; width: 620px; max-width: 94vw; height: 100vh;
  background: #fff; z-index: 21; display: flex; flex-direction: column;
  box-shadow: -8px 0 30px rgba(15,22,32,.18);
}
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-size: 15px; }
.drawer-body { padding: 18px 20px 50px; overflow-y: auto; }
.detail-grid {
  display: grid; grid-template-columns: 110px 1fr 110px 1fr;
  gap: 7px 10px; font-size: 12.5px; margin-bottom: 18px;
}
.detail-grid dt { color: var(--muted); }
.detail-grid dd { margin: 0; word-break: break-all; }
.section-title {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px;
  margin: 20px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line);
}
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--line);
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid var(--muted);
}
.timeline li.fresh::before { border-color: var(--accent); background: var(--accent); }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-title { font-weight: 600; font-size: 13px; }
.tl-time { color: var(--muted); font-size: 11.5px; }
.tl-body { font-size: 12.5px; color: #3d4757; }
.tl-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.log-list { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.log-list li {
  display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px solid #f2f4f7;
}
.log-time { color: var(--muted); flex: 0 0 128px; }

/* ===== 토스트 ===== */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #1d2530; color: #fff; padding: 11px 20px; border-radius: 8px;
  font-size: 13px; z-index: 40; box-shadow: 0 6px 20px rgba(15,22,32,.3);
}
.toast.err { background: var(--err); }

.hidden { display: none !important; }

@media (max-width: 1080px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 110px 1fr; }
}

/* ===== 환율 자동알림 탭 ===== */
.cur-badge {
  display: inline-block; vertical-align: 3px; margin-left: 6px;
  padding: 2px 9px; border-radius: 20px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11.5px; font-weight: 700; letter-spacing: .4px;
}
.next-send {
  display: inline-block; margin-left: 6px; padding: 1px 9px;
  border-radius: 20px; background: #eef0f3; color: #5b6474;
  font-size: 11.5px; font-weight: 600;
}
.fx-source { font-size: 11.5px; color: var(--muted); }
.fx-card { margin-bottom: 16px; }
.fx-card:last-child { margin-bottom: 0; }

/* --- 현황 --- */
.fx-hero {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch;
  gap: 12px; padding: 4px 0 14px;
}
.fx-metric {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px; background: #fbfcfd;
}
.fx-metric.accent {
  border-color: #cfe0fb;
  background: linear-gradient(180deg, #f4f8ff 0%, var(--accent-soft) 100%);
}
.fx-label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.fx-label i { font-style: normal; opacity: .7; }
.fx-value {
  display: block; margin: 3px 0 5px;
  font-size: 28px; font-weight: 700; letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
}
.fx-metric.accent .fx-value { color: var(--accent); }
.fx-meta { display: block; font-size: 11px; color: var(--muted); }
.fx-meta b { color: #5b6474; }
.mini {
  display: inline-block; margin-left: 2px; padding: 0 6px;
  border-radius: 10px; font-size: 10px; font-weight: 700;
}
.mini.ok { background: var(--ok-soft); color: var(--ok); }
.mini.warn { background: var(--warn-soft); color: var(--warn); }

.fx-arrow {
  display: flex; flex-direction: column; justify-content: center;
  font-size: 17px; font-weight: 700; text-align: center; color: var(--muted);
  white-space: nowrap; padding: 0 6px;
}
.fx-arrow small { display: block; font-size: 11px; font-weight: 600; opacity: .8; }
.fx-arrow.down { color: var(--accent); }
.fx-arrow.up { color: var(--err); }

.fx-banner {
  border-radius: var(--radius); padding: 13px 16px; text-align: center;
  font-size: 14px; font-weight: 700; letter-spacing: -.2px;
  background: #f1f3f6; color: #5b6474; border-left: 4px solid #c9ced8;
}
.fx-banner.down { background: var(--accent-soft); color: #1a3f8f; border-left-color: var(--accent); }
.fx-banner.up { background: var(--err-soft); color: var(--err); border-left-color: var(--err); }

.fx-warn {
  margin-top: 10px; background: var(--warn-soft); border: 1px solid #f2e2b6;
  color: var(--warn); border-radius: var(--radius);
  padding: 9px 12px; font-size: 12px; line-height: 1.7;
}

/* --- 근거규정: 좌 버튼 / 우 조문 --- */
.law-link { font-size: 11.5px; color: var(--accent); text-decoration: none; }
.law-link:hover { text-decoration: underline; }

.law-split {
  display: grid; grid-template-columns: 232px minmax(0, 1fr);
  gap: 14px; margin-top: 4px;
}
.law-nav { display: flex; flex-direction: column; gap: 6px; }
.law-btn {
  display: flex; align-items: flex-start; gap: 9px; width: 100%;
  padding: 10px 11px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--text); font-family: inherit;
  transition: border-color .12s, background .12s;
}
.law-btn:hover { border-color: #bcd0f2; background: #fafcff; }
.law-btn.active {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}
.law-no {
  flex: 0 0 20px; height: 20px; margin-top: 1px;
  display: grid; place-items: center; border-radius: 6px;
  background: #e7eaef; color: #5b6474; font-size: 11px; font-weight: 700;
}
.law-btn.active .law-no { background: var(--accent); color: #fff; }
.law-txt { min-width: 0; }
.law-txt b { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.law-txt em { font-style: normal; font-size: 11px; color: var(--muted); }
.law-btn.active .law-txt b { color: #16407f; }

.law-view {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fbfcfd; padding: 16px 18px; min-height: 210px;
}
.law-empty { margin: 0; color: var(--muted); font-size: 12.5px; }
.law-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  padding-bottom: 9px; margin-bottom: 12px; border-bottom: 1px solid var(--line);
}
.law-head h3 { margin: 0; font-size: 14.5px; }
.law-head small { margin-left: 5px; font-weight: 500; color: var(--muted); }
.law-enforced { font-size: 11px; color: var(--muted); }
.law-body p {
  margin: 0 0 9px; font-size: 13px; line-height: 1.85;
  color: #2a3340; text-indent: -2px;
}
.law-body p:last-child { margin-bottom: 0; color: var(--muted); font-size: 11.5px; }
.law-points {
  margin-top: 14px; padding: 12px 14px;
  background: #fff; border: 1px dashed #cfd6e0; border-radius: 8px;
}
.law-points h4 {
  margin: 0 0 7px; font-size: 11.5px; color: var(--accent);
  font-weight: 700; letter-spacing: -.1px;
}
.law-points ul { margin: 0; padding-left: 16px; }
.law-points li { font-size: 12px; line-height: 1.75; color: #3b4453; margin-bottom: 3px; }

/* --- 발송 예정 메일(DRAFT) --- */
.draft-tag {
  display: inline-block; margin-left: 7px; padding: 1px 8px;
  border-radius: 5px; background: #1d2530; color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: 1px; vertical-align: 2px;
}
.draft-note { margin: 2px 0 12px; font-size: 12px; color: var(--muted); }
.draft-frame {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #eef0f3; overflow: hidden;
}
.draft-frame iframe {
  display: block; width: 100%; height: 780px; border: 0; background: #eef0f3;
}

/* --- 수신자 --- */
.fx-recipient-form { display: flex; gap: 6px; margin: 4px 0 8px; }
.fx-in {
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px;
  font-size: 12.5px; font-family: inherit; min-width: 0;
}
.fx-in:focus { outline: none; border-color: var(--accent); }
.fx-in.name { flex: 0 0 82px; }
.fx-in.mail { flex: 1 1 auto; }

.recipient-list { list-style: none; margin: 0; padding: 0; }
.recipient-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.recipient-item.off { opacity: .5; }
.rc-body { flex: 1; min-width: 0; }
.rc-body b { display: block; font-size: 12.5px; }
.rc-mail {
  display: block; font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.recipient-item .btn.toggle { width: auto; padding: 4px 9px; }
.act-detail.err { color: var(--err); }

/* 표 안에서 셀 폭을 다 먹지 않는 좁은 배지 */
.pill.fx-tag { display: inline-block; padding: 3px 11px; }

/* 버튼 글자가 어중간하게 끊기지 않도록 */
.btn { white-space: nowrap; }

@media (max-width: 1100px) {
  .law-split { grid-template-columns: minmax(0, 1fr); }
  .law-nav { flex-direction: row; flex-wrap: wrap; }
  .law-btn { width: auto; flex: 1 1 200px; }
}

@media (max-width: 900px) {
  .fx-hero { grid-template-columns: minmax(0, 1fr); }
  .fx-arrow { flex-direction: row; gap: 6px; align-items: baseline; padding: 2px 0; }
  .fx-recipient-form { flex-wrap: wrap; }
  .fx-in.name { flex: 1 1 100%; }
  .draft-frame iframe { height: 620px; }
}

/* =====================================================================
   업무관리 모듈
   ===================================================================== */

/* --- 사이드바 메뉴 배지(마감 임박 + 미확인 상태변경) --- */
.menu-badge {
  min-width: 18px; padding: 1px 6px; border-radius: 20px;
  background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 700; text-align: center; line-height: 1.5;
}
.menu-badge.hot { background: var(--err); }

/* --- 화물 탭 상단: 마감 임박 배너 --- */
.due-banner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--warn);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px;
}
.due-banner-title { font-size: 13px; font-weight: 700; margin-right: 4px; }
.due-banner .btn { margin-left: auto; }

/* --- 진행 현황 보드(예정 / 진행중 / 오늘 완료) --- */
.board-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.board-col { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.board-head {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 8px 11px; border: 0; border-bottom: 1px solid var(--line);
  background: #f7f8fa; color: #3d4757;
  font-size: 12.5px; font-family: inherit; cursor: pointer; text-align: left;
}
.board-head b { font-weight: 700; }
.board-head:hover { filter: brightness(.97); }
.board-head .count { background: rgba(255, 255, 255, .8); color: inherit; }
/* 목록의 상태 배지와 같은 색 규칙 */
.board-col.planned .board-head { background: #fff; color: var(--text); }
.board-col.doing .board-head { background: var(--accent-soft); color: #1a5fd0; }
.board-col.done_today .board-head { background: var(--ok-soft); color: var(--ok); }

.board-items { list-style: none; margin: 0; padding: 0; max-height: 190px; overflow-y: auto; }
.board-items li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 7px 11px; border-bottom: 1px solid #f2f4f7;
  font-size: 12.5px; cursor: pointer;
}
.board-items li:last-child { border-bottom: 0; }
.board-items li:hover { background: #fafbfd; }
.board-name {
  min-width: 0; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.board-name em { font-style: normal; font-weight: 400; color: #5b6474; }
.board-meta {
  flex: 0 0 auto; font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.board-col.done_today .board-name { text-decoration: line-through; color: #5b6474; }
.board-more {
  display: block; width: 100%; padding: 6px 11px; border: 0;
  border-top: 1px solid #f2f4f7; background: #fcfdfe; color: var(--accent);
  font-size: 11.5px; font-family: inherit; cursor: pointer; text-align: center;
}
.board-more:hover { background: var(--accent-soft); }
.board-empty { margin: 0; padding: 22px 0; text-align: center;
               color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
  .board-cols { grid-template-columns: minmax(0, 1fr); }
}

/* --- 화물 연동 상태변경 알림 --- */
.event-card { border-left: 3px solid var(--accent); }
.event-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.event-item {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 9px 2px; border-bottom: 1px solid #f2f4f7;
}
.event-item:last-child { border-bottom: 0; }
.event-item .act-body { flex: 1; min-width: 0; }
.event-item.auto .act-icon { background: var(--accent-soft); color: var(--accent); }
.event-item.notify .act-icon { background: var(--warn-soft); color: var(--warn); }

/* --- 상태 탭 --- */
.tabs { display: flex; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line); background: #fff; color: #4a5464;
  border-radius: 20px; padding: 5px 13px; font-size: 12.5px; cursor: pointer;
  font-family: inherit;
}
.tab:hover { background: #f3f5f8; }
.tab.active { background: #1d2530; border-color: #1d2530; color: #fff; }
.tab b { font-weight: 700; margin-left: 4px; opacity: .85; }
/* 화면을 둘로 나누는 큰 구분 버튼(수출입통관의 수입 / 수출) */
.tabs.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.tabs.split .tab {
  padding: 14px 0; border-radius: var(--radius);
  font-size: 16px; font-weight: 700; letter-spacing: .02em;
}

.filter-line { display: flex; gap: 6px; margin-bottom: 14px; }
.filter-line .fx-in { height: 30px; }

/* --- 폼: select / 체크박스 --- */
.f select {
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 8px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--text);
}
.f select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.f.check .check-line {
  display: flex; align-items: center; gap: 6px; height: 33px;
  font-weight: 400; color: #4a5464;
}
.f.check input[type="checkbox"] { width: 14px; height: 14px; }

/* --- 업무 표 --- */
/* 고객사 · TO DO · B/L · 마감일 · 상태 · 메모 · 관리 */
.table.fixed .t-client  { width: 13%; }
.table.fixed .t-subject { width: 24%; }
.table.fixed .t-cargo   { width: 14%; }
.table.fixed .t-due     { width: 9.5%; }
.table.fixed .t-status  { width: 8.5%; }
.table.fixed .t-memo    { width: 20%; }
.table.fixed .t-act     { width: 9%; }

.memo-cell { color: #4a5464; font-size: 12px; line-height: 1.45; }
/* 두 줄까지만 보이고 나머지는 말줄임 - 전체 내용은 title(툴팁)로 뜬다 */
.memo-text {
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; word-break: break-word; cursor: help;
}
.next-action { color: #4a5464; font-size: 12.5px; word-break: break-all; }
.table tr.flagged td { background: #fffdf5; }
.cell-sub.flag { color: var(--warn); font-weight: 600; }

/* 상태 배지(클릭하면 다음 상태) */
.pill.status {
  width: 100%; border: 1px solid transparent; cursor: pointer;
  font-family: inherit; font-size: 12px;
}
.pill.status.planned { background: #fff; color: var(--text); border-color: var(--text); }
.pill.status.doing { background: var(--accent-soft); color: #1a5fd0; border-color: #cfe0fb; }
.pill.status.done { background: var(--ok-soft); color: #0d6b4d; border-color: #b8e3d1; }
.pill.status:hover { filter: brightness(.97); }

/* 마감일 셀 */
.due-cell { text-align: center; font-variant-numeric: tabular-nums; font-size: 12px; white-space: nowrap; }
.due-cell .dday { font-size: 11px; font-weight: 700; }
.due-cell.over { color: var(--err); }
.due-cell.over .dday { color: var(--err); }
/* 오늘 마감(D-DAY)은 칸 전체를 빨갛게 - .table td.hl 배경을 이겨야 해서 선택자를 길게 잡는다 */
.table td.due-cell.today {
  background: var(--err-soft); color: var(--err); font-weight: 700;
}
.due-cell.today .dday { color: var(--err); }
.due-cell.soon .dday { color: var(--accent); }
.due-cell.far .dday, .due-cell.none .dday { color: var(--muted); font-weight: 400; }

/* --- 전이 규칙 목록 --- */
.rule-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.rule-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 9px 2px; border-bottom: 1px solid #f2f4f7;
}
.rule-item:last-child { border-bottom: 0; }
.rule-item.off { opacity: .55; }
.rule-body { flex: 1; min-width: 0; }
.rule-kw { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.rule-desc { font-size: 11.5px; color: #5b6474; margin-top: 2px; word-break: keep-all; }
.rule-actions { display: flex; gap: 4px; align-items: center; }
.rule-actions .btn.toggle { width: auto; padding: 4px 7px; }

/* --- 드로어 안의 폼 --- */
.drawer-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.drawer-form .form-actions { justify-content: flex-start; gap: 10px; }
/* 사이드 카드처럼 좁은 곳에서 쓰는 2단 버전(기본은 드로어용 4단) */
.detail-grid.tight {
  grid-template-columns: 74px minmax(0, 1fr);
  row-gap: 4px; font-size: 12px; margin-bottom: 4px;
}
.detail-grid.tight dd { word-break: break-word; }
.btn.block { display: block; width: 100%; margin-top: 8px; }
code {
  background: #f1f3f6; border-radius: 4px; padding: 0 4px;
  font-family: Consolas, "D2Coding", monospace; font-size: 11px;
}


/* =====================================================================
   업무관리 - 월간 달력
   ===================================================================== */
.cal-card .card-head { align-items: center; margin-bottom: 4px; }
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.cal-nav .card-title { margin: 0; }
.cal-label {
  min-width: 128px; text-align: center;
  font-size: 17px; font-weight: 700; letter-spacing: -.3px;
  font-variant-numeric: tabular-nums;
}
/* 전월·익월은 동그란 아이콘 버튼 */
#btn-cal-prev, #btn-cal-next {
  width: 28px; height: 28px; padding: 0; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 600; line-height: 1; color: #5b6474;
}
#btn-cal-prev:hover, #btn-cal-next:hover { background: #eef1f5; color: var(--text); }
#btn-cal-today { margin-left: 2px; padding: 4px 11px; border-radius: 20px; font-size: 11.5px; }

/* 요일 머리글 + 격자를 하나의 블록으로 묶는다 */
.cal-grid-head, .cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cal-grid-head {
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: 8px 8px 0 0; background: #f8f9fb; overflow: hidden;
}
.cal-grid-head span {
  padding: 8px 6px; font-size: 11px; font-weight: 600;
  color: #8b94a3; text-align: center; letter-spacing: 1px;
}
.cal-grid-head .sun { color: #c67b76; }
.cal-grid-head .sat { color: #7b96c6; }

.cal-grid {
  border: 1px solid var(--line); border-radius: 0 0 8px 8px;
  overflow: hidden; background: var(--line); gap: 1px;
}
/* 칸 사이 선은 격자 배경(1px gap)으로 그린다 - 테두리가 겹쳐 두꺼워지지 않는다 */
.cal-day {
  min-height: 104px; padding: 5px 6px 7px; background: #fff;
  cursor: pointer; transition: background .12s;
}
.cal-day:hover { background: #fafbfc; }
.cal-day.sun, .cal-day.sat { background: #fcfdfe; }
.cal-day.sun:hover, .cal-day.sat:hover { background: #f7f9fb; }
.cal-day.outside { background: #fafbfc; }
.cal-day.outside .cal-date { color: #c8cdd6; }
.cal-day.outside .cal-item { opacity: .5; }

.cal-num { display: flex; align-items: center; height: 22px; padding: 0 1px 2px; }
.cal-date {
  display: grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 3px; border-radius: 50%;
  font-size: 11.5px; font-weight: 600; color: #6b7686;
  font-variant-numeric: tabular-nums;
}
.cal-day.sun .cal-date { color: #c0362c; }
.cal-day.sat .cal-date { color: #2f6fd0; }

/* 공휴일: 일요일과 같은 빨간날 + 칸 안에 휴일 이름.
   근로자의 날처럼 관공서 공휴일이 아닌 휴무는 회색으로 구분한다. */
.cal-day.holiday { background: #fdf6f5; }
.cal-day.holiday:hover { background: #fbeeec; }
.cal-day.holiday .cal-date { color: #c0362c; }
.cal-holiday {
  margin-left: 3px; min-width: 0;
  font-size: 10.5px; font-weight: 600; color: #c0362c;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-day.observance .cal-holiday { color: #7c8493; font-weight: 500; }

/* 오늘: 진한 테두리 + 날짜를 채운 원으로 */
.cal-day.today { background: #fff; box-shadow: inset 0 0 0 2px var(--text); }
.cal-day.today .cal-date { background: var(--text); color: #fff; font-weight: 700; }

.cal-items { display: flex; flex-direction: column; gap: 3px; }
.cal-item {
  display: block; width: 100%; text-align: left;
  border: 1px solid transparent; border-radius: 4px;
  padding: 2px 6px; cursor: pointer;
  font-family: inherit; font-size: 10.5px; font-weight: 500;
  line-height: 1.5; letter-spacing: -.2px;
  background: #eef0f4; color: #4a5464;
}
.cal-item:hover { filter: brightness(.96); }
.cal-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 예정 = 흰 바탕 · 검정 글씨 · 검정 테두리 */
.cal-item.planned { background: #fff; color: var(--text); border-color: #c6ccd6; }
.cal-item.doing { background: var(--accent-soft); color: #1a5fd0; border-color: #cfe0fb; }
/* 완료 = 회색 */
.cal-item.done {
  background: #eef0f3; color: #949cab; border-color: #e6e9ee;
  text-decoration: line-through;
}
.cal-item.late {
  background: var(--err-soft); color: var(--err); border-color: #f3cdc9; font-weight: 600;
}

.cal-error { padding: 30px 0; text-align: center; color: var(--muted); font-size: 12.5px; }

@media (max-width: 1100px) {
  .cal-day { min-height: 88px; }
  .cal-item { font-size: 10px; }
}

/* =====================================================================
   출근 / 퇴근
   ===================================================================== */
.attend-state {
  align-self: center; font-size: 11.5px; color: var(--muted);
  font-variant-numeric: tabular-nums; margin-right: 2px;
}
.btn.attend { border-width: 1px; font-weight: 600; }
.btn.attend.in { background: var(--warn-soft); color: #8a5f00; border-color: #f0dcae; }
.btn.attend.in:hover { background: #fbecc8; }
.btn.attend.out { background: #eef1f6; color: #46536a; border-color: #dde2ea; }
.btn.attend.out:hover { background: #e5e9f0; }
.btn.attend.done { opacity: .62; }

/* =====================================================================
   팝업(모달)
   ===================================================================== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 40;
}
.modal {
  position: fixed; z-index: 41; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 40px)); max-height: calc(100vh - 80px);
  display: flex; flex-direction: column;
  background: var(--panel); border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(16, 24, 40, .28);
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.modal-body { padding: 14px 18px 20px; overflow-y: auto; }

.brief-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip.muted { background: #f4f5f7; color: #98a1af; border-color: var(--line); }
.brief-block { margin-bottom: 14px; }
.brief-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: #3d4757;
  padding-bottom: 5px; border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.brief-block.err .brief-head { color: var(--err); border-color: #f5cfcc; }
.brief-block.warn .brief-head { color: var(--warn); border-color: #f2e2b6; }
.brief-block.ok .brief-head { color: var(--ok); border-color: #cdeade; }
.brief-block.info .brief-head { color: var(--accent); border-color: #cfe0fb; }
.brief-list { list-style: none; margin: 0; padding: 0; }
.brief-item {
  display: grid; grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 3px 8px; align-items: center;
  padding: 6px 4px; border-bottom: 1px solid #f4f6f8; font-size: 12.5px;
}
.brief-list .brief-item { cursor: pointer; }
.brief-item:last-child { border-bottom: 0; }
.brief-item:hover { background: #fafbfd; }
.brief-due {
  font-size: 11.5px; font-weight: 600; color: #4a5464;
  font-variant-numeric: tabular-nums;
}
.brief-due.none { color: var(--muted); font-weight: 400; }
.brief-name { font-weight: 600; word-break: break-all; }
.brief-action {
  grid-column: 2 / span 2; font-size: 11.5px; color: #5b6474;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brief-empty { margin: 6px 0; font-size: 12.5px; color: var(--muted); }
.brief-empty.big { text-align: center; padding: 26px 0; font-size: 13px; }
.brief-note {
  margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted); text-align: center;
}

@media (max-width: 900px) {
  .cal-day { min-height: 74px; }
  .cal-text { font-size: 10px; }
  .brief-item { grid-template-columns: 62px minmax(0, 1fr); }
  .brief-item .tag { grid-column: 2; justify-self: start; }
}

/* =====================================================================
   업무 등록 - 화물 1건에 할 일 여러 줄
   ===================================================================== */
/* 업무 등록 카드: 눈에 띄게 검정 테두리 */
.card.reg-card { border: 2px solid var(--text); }
.card.reg-card .card-title { margin-bottom: 16px; }

/* 등록 폼: 왼쪽 2/3 에 고객사·B/L·TO DO, 오른쪽 1/3 에 메모 */
.reg-grid {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 12px 20px; align-items: stretch;
}
.reg-left { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.reg-left .todo-head { margin-top: 4px; }
.reg-memo { height: 100%; }
.reg-memo textarea {
  flex: 1; min-height: 150px; resize: vertical;
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px;
  font-size: 13px; font-family: inherit; line-height: 1.5;
  color: var(--text); background: #fff;
}
.reg-memo textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* 마감일: 날짜 + 요일 + 하루씩 옮기는 화살표 */
.due-box { display: flex; align-items: center; gap: 4px; min-width: 0; }
/* 등록 폼은 .fx-in, 수정창(drawer)은 .f input 스타일을 쓴다 - 둘 다 늘어나야 한다 */
.due-box > input { flex: 1 1 auto; min-width: 0; }
.due-box .dow {
  flex: 0 0 22px; font-size: 11px; color: var(--muted);
  text-align: center; font-weight: 600;
}
.spin { display: flex; flex-direction: column; flex: 0 0 auto; }
.spin-btn {
  width: 18px; height: 16px; padding: 0; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: #8b94a3;
  font-size: 7px; line-height: 1; font-family: inherit;
}
.spin-btn:first-child { border-radius: 4px 4px 0 0; border-bottom: 0; }
.spin-btn:last-child { border-radius: 0 0 4px 4px; }
.spin-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: #cfe0fb; }
/* 수정창의 입력칸은 등록 폼보다 높다. 화살표가 그 높이를 반씩 나눠 갖도록. */
.drawer-form .due-box { align-items: stretch; }
.drawer-form .spin-btn { height: auto; flex: 1 1 0; }
.drawer-form .due-box .dow { display: flex; align-items: center; justify-content: center; }

.todo-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 16px 0 8px; padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.todo-title { font-size: 12.5px; font-weight: 600; color: #3d4757; }
.todo-title em {
  display: block; font-style: normal; font-weight: 400;
  font-size: 11.5px; color: var(--muted); margin-top: 2px;
}

.todo-cols, .todo-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 162px 84px 28px;
  gap: 6px; align-items: center;
}
.todo-cols {
  padding: 0 2px 4px; font-size: 11px; color: var(--muted); font-weight: 500;
}
.todo-cols span:first-child { grid-column: 2; }   /* 번호 칸은 머리글 없음 */
.todo-rows { display: flex; flex-direction: column; gap: 6px; }
.todo-row { padding: 1px 0; }
.todo-no {
  font-size: 11px; color: var(--muted); text-align: center;
  font-variant-numeric: tabular-nums;
}
.todo-row .fx-in { height: 32px; width: 100%; }
.todo-row select.fx-in { padding: 0 6px; }
.todo-row .btn.danger.sm { padding: 5px 6px; line-height: 1; }
.todo-row .btn:disabled { opacity: .3; }

/* 목록의 화물번호 - 누르면 그 화물의 할 일만 걸러 본다 */
.bl-link {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-family: Consolas, "D2Coding", monospace; font-size: 12px;
  font-weight: 600; color: var(--accent); text-align: left;
  word-break: break-all;
}
.bl-link:hover { text-decoration: underline; }
.bl-count {
  display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 10px; font-weight: 700;
}

@media (max-width: 1240px) {
  .todo-cols { display: none; }
  .todo-row {
    grid-template-columns: 22px minmax(0, 1fr) 30px;
    row-gap: 4px; padding: 8px 0; border-bottom: 1px solid #f2f4f7;
  }
  .todo-row .due-box, .todo-row select[name="status"] { grid-column: 2; }
  .reg-grid { grid-template-columns: minmax(0, 1fr); }
  .reg-memo textarea { min-height: 84px; }
}

/* =====================================================================
   업무 목록 - 컬럼별 필터 행
   ===================================================================== */
.table thead .filter-row td {
  padding: 4px 5px 7px; border-bottom: 1px solid var(--line);
  background: #fbfcfd; vertical-align: middle;
}
.col-filter {
  width: 100%; height: 27px; padding: 0 6px;
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 11.5px; font-family: inherit; color: var(--text); background: #fff;
}
.col-filter:focus { outline: none; border-color: var(--accent); }
.col-filter::placeholder { color: #b3bac5; }
/* 값이 들어간 칸은 눈에 띄게 (JS 가 .on 을 붙인다) */
.col-filter.on {
  border-color: var(--accent); background: var(--accent-soft);
  color: var(--accent); font-weight: 600;
}
.filter-row .filter-clear { text-align: center; }
.filter-row .filter-clear .btn { padding: 4px 8px; line-height: 1; }

.filter-badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 10.5px; font-weight: 700; vertical-align: middle;
}
.filter-line .fx-in { min-width: 260px; }

@media (max-width: 1240px) {
  .filter-line .fx-in { min-width: 150px; }
}

/* 완료 기록 탭: 완료일 기간 + 되돌리기 */
.done-range { display: flex; align-items: center; gap: 5px; font-size: 11.5px; }
.done-range em { font-style: normal; color: var(--muted); font-weight: 500; }
.done-range .fx-in { min-width: 0; width: 130px; height: 30px; }
.date-filter.on { border-color: var(--accent); background: var(--accent-soft); }
.btn.sm.reopen { color: var(--accent); border-color: #cfe0fb; }
.btn.sm.reopen:hover { background: var(--accent-soft); }
/* 완료된 행은 한 톤 죽인다 */
.table tbody tr.done td { background: #fcfdfe; }
.table tbody tr.done .owner { color: #5b6474; }

/* ===================================================================
   Outlook 연동 탭
   =================================================================== */
.page-head .head-actions #mail-account { min-width: 220px; height: 32px; }

/* 목록 */
.table.fixed#mail-table .m-when    { width: 88px; }
.table.fixed#mail-table .m-folder  { width: 132px; }
.table.fixed#mail-table .m-from    { width: 170px; }
.table.fixed#mail-table .m-subject { width: auto; }
.table.fixed#mail-table .m-att     { width: 62px; }
.table.fixed#mail-table .m-done    { width: 132px; }

/* 자동분류 폴더 배지. 상위 경로는 작게, 실제 폴더명을 굵게 */
.mail-folder-cell { overflow: hidden; }
.mail-folder {
  display: inline-block; max-width: 100%; padding: 2px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); font-size: 11.5px;
  line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mail-folder em {
  display: block; font-style: normal; font-size: 10px; opacity: .75;
  overflow: hidden; text-overflow: ellipsis;
}
.mail-folder b { font-weight: 700; }
.mail-folder.none { background: #eef0f4; color: var(--muted); font-weight: 500; }

/* 목록이 길어도 아래 '선택한 메일'이 화면에서 멀어지지 않게 스크롤 영역으로 가둔다 */
.mail-list-wrap { max-height: 420px; overflow-y: auto; }
.mail-list-wrap thead th {
  position: sticky; top: 0; z-index: 1; background: var(--panel);
}

.mail-row { cursor: pointer; }
.mail-row:hover td { background: var(--accent-soft); }
.mail-row.sel td { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.mail-row.unread .cell-main { font-weight: 700; }
.mail-row.unread .owner::before {
  content: "●"; color: var(--accent); font-size: 8px; vertical-align: 2px; margin-right: 4px;
}
.mail-row .cell-sub {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.mail-att-cell { color: var(--muted); font-size: 12px; }
.mail-done .mail-tag { margin: 0 3px 2px 0; }

.mail-check { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.mail-check em { font-style: normal; }

/* 상세 */
.mail-detail .card-title {
  max-width: 78%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.detail-grid.tight dd.wrap { word-break: break-all; }
.mail-bl { margin-right: 4px; font-family: "Consolas", "D2Coding", monospace; }

.mail-att { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 2px; }
.mail-att-label { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.mail-file {
  display: inline-flex; align-items: baseline; gap: 6px; max-width: 320px;
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: #fbfcfe; color: var(--text); text-decoration: none; font-size: 12px;
}
.mail-file:hover { border-color: var(--accent); background: var(--accent-soft); }
.mail-file b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-file em { font-style: normal; color: var(--muted); font-size: 11px; flex: none; }

/* 이 메일로 할 수 있는 일 셋. 무게를 똑같이 주고(같은 크기·모양) 색과 아이콘으로만
   구분한다 - 하나만 primary 로 두면 나머지가 부수적인 기능처럼 보인다. */
.mail-actions {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; margin: 16px 0 0;
}
.mail-act {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 13px; cursor: pointer; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--text); font-family: inherit;
  transition: border-color .12s, box-shadow .12s, transform .12s, background .12s;
}
.mail-act:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(20, 32, 48, .09); }
.mail-act:active { transform: none; }

.ma-icon {
  flex: 0 0 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1; background: #eef0f4;
}
.ma-text { display: flex; flex-direction: column; min-width: 0; }
.ma-text b { font-size: 13px; font-weight: 700; line-height: 1.3; }
.ma-text em {
  font-style: normal; font-size: 11px; color: var(--muted); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 색은 기능별로 하나씩 - 업무=파랑, 화물=초록, 폴더링=명함 금색 */
.mail-act.task  .ma-icon { background: var(--accent-soft); }
.mail-act.cargo .ma-icon { background: var(--ok-soft); }
.mail-act.file  .ma-icon { background: #fdf0cf; }

.mail-act.task:hover,  .mail-act.task.on  { border-color: var(--accent); }
.mail-act.cargo:hover, .mail-act.cargo.on { border-color: var(--ok); }
.mail-act.file:hover,  .mail-act.file.on  { border-color: var(--gold); }

/* 패널이 열려 있는 버튼은 눌린 상태로 둔다 */
.mail-act.on { box-shadow: none; transform: none; }
.mail-act.task.on  { background: var(--accent-soft); }
.mail-act.cargo.on { background: var(--ok-soft); }
.mail-act.file.on  { background: #fdf6e3; }
.mail-act.task.on  .ma-text b { color: var(--accent); }
.mail-act.cargo.on .ma-text b { color: var(--ok); }
.mail-act.file.on  .ma-text b { color: #8c6209; }
.mail-act.on .ma-icon { background: #fff; }

@media (max-width: 1100px) {
  .mail-actions { grid-template-columns: minmax(0, 1fr); }
}

/* 본문 */
.mail-body-frame {
  margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: #fff;
}
.mail-body-frame iframe { width: 100%; height: 460px; border: 0; display: block; }

/* 액션 패널(폴더링 / 업무등록 / 화물등록 공용) */
.mail-panel {
  margin-top: 12px; padding: 14px 16px 16px;
  border: 1px solid #cfe0fb; border-radius: var(--radius); background: #f7faff;
}
.mp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mp-head h3 { margin: 0; font-size: 14px; }
.mp-head .th-hint { flex: 1; }
.mp-head .mp-close { margin-left: auto; }
.mp-grid { margin-bottom: 4px; }
/* 업무관리 패널은 업무관리 탭의 등록 폼(reg-grid/todo-*)을 그대로 쓴다 */
.mail-panel .reg-left .todo-head { margin-top: 0; padding-top: 12px; }
.mail-panel .reg-memo textarea { min-height: 132px; background: #fff; }
.mail-panel .form-actions { margin-top: 10px; }

.mp-preview {
  margin: 8px 0 4px; padding: 8px 10px; border-radius: 8px;
  background: #fff; border: 1px dashed #cfe0fb; font-size: 12px; color: var(--muted);
}
.mp-preview b {
  display: block; margin-top: 2px; color: var(--text); word-break: break-all;
  /* 경로에 한글이 섞이므로 한글 글꼴을 폴백에 둔다 */
  font-family: "Consolas", "D2Coding", "Malgun Gothic", "맑은 고딕", monospace;
}

.mp-files { margin-top: 10px; }
.mp-files-head {
  display: flex; align-items: baseline; gap: 8px; font-size: 11.5px;
  font-weight: 700; color: var(--muted); margin-bottom: 6px;
}
.mp-files-head .th-hint { font-weight: 500; }
.mp-file {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px;
  border-radius: 6px; font-size: 12.5px; cursor: pointer;
}
.mp-file:hover { background: #fff; }
.mp-file b { font-weight: 600; }
.mp-file em { font-style: normal; color: var(--muted); font-size: 11px; margin-left: auto; }
.mp-file.inline b { color: var(--muted); font-weight: 500; }
.mp-file .tag { flex: none; }

.mp-result {
  margin-top: 12px; padding: 10px 12px; border-radius: 8px;
  background: #fff; border: 1px solid var(--ok); border-left-width: 3px;
}
.mp-result-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.mp-result-head b {
  flex: 1; font-size: 12px; word-break: break-all;
  font-family: "Consolas", "D2Coding", "Malgun Gothic", "맑은 고딕", monospace;
}
.mp-result ul { margin: 0; padding-left: 18px; font-size: 12.5px; }
.mp-result li { margin: 2px 0; }
.mp-result li.err { color: var(--err); }

@media (max-width: 1240px) {
  .page-head .head-actions #mail-account { min-width: 150px; }
  .mail-body-frame iframe { height: 360px; }
}

/* Outlook 보안 경고창에 막혔을 때의 안내(끄는 방법을 그 자리에서 알려준다) */
.mail-guard-help {
  max-width: 660px; margin: 10px auto 0; padding: 10px 12px; text-align: left;
  border: 1px solid var(--warn); border-left-width: 3px; border-radius: 8px;
  background: var(--warn-soft); color: var(--warn);
  font-size: 12px; line-height: 1.75; font-weight: 500;
}
.mail-guard-help b { color: #6d4b00; }
.notice .mail-guard-help { margin-left: 0; }

/* ── 환율: 과세환율 불일치 경고 ─────────────────────────────────────
   안내한 예상값과 관세청 고시값이 다를 때만 보인다. 거래처에 정정 안내가
   필요할 수 있는 일이라, 탭에 머무는 동안 계속 눈에 띄게 둔다. */
.fx-verify-banner {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; padding: 11px 14px;
  background: #fdf0ee; border: 1px solid #f0c7c1; border-radius: 10px;
  color: var(--err); font-size: 13px;
}
.fx-verify-banner > div { flex: 1; min-width: 0; }
.fx-verify-mark {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--err); color: #fff; font-size: 13px; font-weight: 700;
}
.fx-verify-line { display: block; margin-top: 2px; color: var(--text); }
.fx-verify-line b { color: var(--err); }
.fx-verify-banner .btn { flex: 0 0 auto; }

/* 팝업 안의 '항목 : 값' 표(과세환율 불일치 상세) */
.modal-lead { margin: 0 0 12px; font-size: 13px; line-height: 1.6; }
table.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
table.kv th, table.kv td {
  padding: 7px 2px; border-bottom: 1px solid var(--line); text-align: left;
}
table.kv th { width: 110px; color: var(--muted); font-weight: 500; }
table.kv td { font-variant-numeric: tabular-nums; }
table.kv tr:last-child th, table.kv tr:last-child td {
  border-bottom: 0; font-weight: 700; color: var(--err);
}
/* 확인을 못 한 경우: 틀린 건 아니므로 빨강 대신 회색으로 */
.fx-verify-banner.muted { background: #f4f5f7; border-color: var(--line); color: var(--muted); }
.fx-verify-banner.muted .fx-verify-mark { background: var(--muted); }

/* ── 수출입통관 · 수입: 수입자 + 서류 첨부 ─────────────────────────── */
.imp-company-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.f.imp-company { flex: 1 1 320px; max-width: 420px; }
/* 업체명 칸 오른쪽 바로 고르기 */
.quick-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-pick {
  padding: 9px 14px; border-radius: 20px; border: 1.5px solid var(--line); background: #fff;
  font: 600 13px/1 inherit; font-family: inherit; color: var(--text); cursor: pointer;
}
.quick-pick:hover { border-color: var(--text); }
.quick-pick.on { background: var(--text); border-color: var(--text); color: #fff; }
.f.imp-company input { padding: 10px 12px; font-size: 14px; }
.f-title { font-size: 12px; font-weight: 500; color: #4a5464; margin-bottom: 6px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 150px; padding: 24px; text-align: center; cursor: pointer;
  border: 2px dashed #c9d1dd; border-radius: var(--radius); background: #fafbfd;
  color: var(--muted); font-size: 12.5px;
  transition: border-color .15s, background-color .15s;
}
.dropzone b { font-size: 15px; color: var(--text); }
.dropzone:hover { border-color: #9fb0c6; }
.dropzone:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 파일을 끌고 들어왔을 때: 여기에 놓으면 된다는 것을 분명히 */
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone.over b { color: var(--accent); }
.file-list { list-style: none; margin: 12px 0 0; padding: 0; }
.file-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.file-ext {
  min-width: 42px; padding: 2px 6px; border-radius: 5px; text-align: center;
  background: #eef1f5; color: #4a5464; font-size: 11px; font-weight: 700;
}
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.file-remove {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  width: 28px; height: 28px; border-radius: 6px; font-size: 13px;
}
.file-remove:hover { background: #f3f5f8; color: var(--err); }
.file-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.file-dir { color: var(--muted); }
/* 큰 폴더를 읽는 동안: 아직 담는 중이라는 표시 */
.dropzone.busy { cursor: progress; opacity: .6; }
/* 첨부 줄의 서류 종류 표시 */
.file-item { grid-template-columns: auto minmax(0, 1fr) auto auto auto; }
.doc-type { padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: #eef1f5; color: #4a5464; white-space: nowrap; }
.doc-type.t-bl { background: #e8f0fe; color: #1f5fc4; }
.doc-type.t-invoice { background: #e3f5ee; color: #12805c; }
.doc-type.t-packing { background: #fdf3dc; color: #9a6b00; }
.doc-type.t-origin { background: #f3e8fd; color: #7a3fb8; }
.file-note { display: block; color: var(--err); font-size: 11.5px; white-space: normal; }

/* 수입신고 정보 */
.imp-result { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.imp-result-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.imp-result-head h3 { margin: 0; font-size: 15px; }
.imp-state { font-size: 12.5px; color: var(--muted); }
.imp-note { margin: 4px 0 12px; font-size: 12px; color: var(--muted); }
.imp-fields { width: 100%; border-collapse: collapse; font-size: 13px; }
.imp-fields th, .imp-fields td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.imp-fields thead th { font-size: 11.5px; color: var(--muted); font-weight: 500; background: #fafbfd; }
.imp-fields tbody th { width: 130px; font-weight: 500; color: #4a5464; white-space: nowrap; }
.imp-fields td.src { width: 30%; color: var(--muted); font-size: 12px; word-break: break-all; }
.imp-fields tr.empty td { color: #b3bac6; }
.file-item.child { padding-left: 18px; background: #fafbfd; }
.file-item.child .file-ext { background: none; color: var(--muted); min-width: 0; }
/* 품목 표: 칸이 많아 좁은 화면에서는 옆으로 밀어 본다 */
.imp-items { margin-top: 22px; }
.table-scroll { overflow-x: auto; margin-top: 8px; }
.imp-items-table td, .imp-items-table th { white-space: nowrap; }
.imp-items-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* 모델규격: 왼쪽 2열(HS·품목구분)은 별도 표처럼, 가운데 빈 칸으로 띄우고 오른쪽 6열 */
.spec-head { align-items: center; }
.spec-group + .spec-group { margin-top: 16px; }
/* HS 별 표들의 열이 위아래로 맞도록 열 너비를 고정한다(규격1 만 남는 폭을 쓴다) */
.spec-group .spec-table { table-layout: fixed; min-width: 860px; }
.spec-group .spec-table th:nth-child(1) { width: 110px; }
.spec-group .spec-table th:nth-child(2) { width: 76px; }
.spec-group .spec-table th:nth-child(5) { width: 120px; }
.spec-group .spec-table th:nth-child(6) { width: 80px; }
.spec-group .spec-table th:nth-child(7) { width: 54px; }
.spec-group .spec-table th:nth-child(8) { width: 96px; }
.spec-group .spec-table th:nth-child(9) { width: 110px; }
.spec-group .spec-table td:nth-child(4) { white-space: normal; }
.spec-group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: #4a5464; }
.spec-table { border-collapse: separate; border-spacing: 0; font-size: 13px; width: 100%; }
.spec-table th, .spec-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.spec-table thead th { font-size: 11.5px; color: var(--muted); font-weight: 500; background: #fafbfd; border-top: 1px solid var(--line); }
.spec-table .side { background: #f6f7fa; color: #4a5464; }
.spec-table thead .side { background: #eef1f5; }
.spec-table th.side:first-child, .spec-table td.side:first-child { border-left: 1px solid var(--line); }
.spec-table th.side + th.side, .spec-table td.side + td.side { border-right: 1px solid var(--line); }
.spec-table .gap { width: 14px; min-width: 14px; padding: 0; border: 0; background: none; }
.spec-table th:nth-child(4), .spec-table td:nth-child(4) { border-left: 1px solid var(--line); }
.spec-table th:last-child, .spec-table td:last-child { border-right: 1px solid var(--line); }
.spec-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.spec-table tr.fee td:not(.gap) { background: #fffaf0; }
.spec-table tr.fee td.side { color: var(--muted); }
.spec-check { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.spec-check.ok { color: var(--ok); }
.spec-check.bad { color: var(--err); font-weight: 600; }
.std-fields { margin-top: 22px; }
.std-fields thead th { color: var(--text); font-size: 13px; font-weight: 600; }

/* 수출 구분 아래 내용 자리 */
.exp-body { margin-top: 16px; padding: 40px 20px; border: 1px dashed var(--line); border-radius: var(--radius); }

/* ===== 설정 · 처음 설정 안내 ===== */
.setup-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; padding: 12px 16px;
  background: var(--warn-soft); color: var(--warn); border: 1px solid #f2e2b6; border-radius: var(--radius); font-size: 13px;
}
.setup-banner .btn { margin-left: auto; }
.card-title em.sub { font-style: normal; font-weight: 400; margin-left: 6px; }
.env-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .env-grid { grid-template-columns: 1fr; } }

/* ===== 휴대폰 폭: 사이드바를 위쪽 가로 메뉴로 ===== */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar { width: auto; flex: none; height: auto; position: static; }
  .brand { display: flex; align-items: baseline; gap: 8px; padding: 12px 16px 8px; border-bottom: 0; }
  .brand-bar, .brand-app { display: none; }
  .brand-ko { margin: 0; }
  .menu { display: flex; gap: 4px; padding: 0 12px 10px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #3a4c66 transparent; }
  .menu-item { width: auto; flex: none; margin: 0; padding: 8px 12px; white-space: nowrap; }
  .menu-item .badge { display: none; }
  .sidebar-foot { padding: 0 16px 10px; border-top: 0; }
  .sidebar-foot .stat-row { display: none; }
  .side-user { margin: 0; padding: 0; border-top: 0; }
  .side-user > span { flex: 0 1 auto; }
  .content { padding: 16px 16px 40px; }
  .page-head { flex-wrap: wrap; }
}

/* ---------------- 카톡 연동 ---------------- */
.mail-tpl summary { cursor: pointer; }
.mail-tpl[open] summary { margin-bottom: 8px; }
.mail-tpl .form-actions { margin-top: 8px; }
.kk-setup textarea, .mail-tpl textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #c9d1dd; border-radius: 7px; font: inherit; resize: vertical;
}
.kk-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.kk-rooms { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line);
  border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
.kk-room-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 10px;
  background: #f7f8fa; border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.kk-room-add input { flex: 1; min-width: 240px; padding: 6px 10px; border: 1px solid #c9d1dd; border-radius: 7px; font: inherit; font-size: 13px; }
.kk-room-add .form-msg { flex-basis: 100%; }
.kk-room-add .form-msg:empty { display: none; }
.kk-room { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 0; border-left: 3px solid transparent; }
.kk-room + .kk-room { border-top: 1px solid #f0f2f5; }
.kk-room.on { border-left-color: var(--gold); background: #fbfcfe; }
.kk-room-name {
  flex: 1; min-width: 0; text-align: left; padding: 6px 12px; font: inherit; font-size: 13.5px;
  background: none; border: 0; color: var(--text); cursor: pointer; overflow-wrap: anywhere;
}
.kk-room.on .kk-room-name { font-weight: 600; }
.kk-room-name:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.kk-new { flex: none; font-size: 12px; font-weight: 600; color: var(--warn); }
.kk-read { flex: none; }
.kk-read.hot { background: var(--gold); border-color: var(--gold); color: var(--side); font-weight: 700; }
.kk-review { margin: 0; }
.kk-review-at { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--muted); }
.kk-review-table th { width: 200px; vertical-align: top; text-align: left; }
.kk-review-table td { vertical-align: top; }
.kk-sub { display: block; font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.kk-rv-item { overflow-wrap: anywhere; }
.kk-rv-item em { color: var(--muted); font-style: normal; font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok); }
.dot.off { background: #b8c0cc; }
.kk-split { display: block; }
.kk-chat { padding: 0; overflow: hidden; }
.kk-chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.kk-state { flex: 1; min-width: 0; font-size: 12.5px; }
.kk-state em { color: var(--muted); font-style: normal; }
.kk-chat-head input { width: 200px; }
.kk-msgs { list-style: none; margin: 0; padding: 4px 0; height: calc(100vh - 330px); min-height: 320px; overflow-y: auto; font-size: 12.5px; }
.kk-day { text-align: center; font-size: 12px; color: var(--muted); padding: 10px 0 4px; }
.kk-msg { padding: 6px 14px 6px 12px; border-left: 3px solid transparent; }
.kk-msg:hover { background: #f7f9fc; }
.kk-msg.on { background: var(--accent-soft); border-left-color: var(--accent); }
.kk-msg label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--muted); }
.kk-msg label b { color: var(--text); font-weight: 600; }
.kk-who .tag { margin-left: 4px; }
.kk-text { margin: 2px 0 0 24px; white-space: pre-wrap; overflow-wrap: anywhere; }
.kk-file { display: inline-block; margin: 3px 0 0 24px; overflow-wrap: anywhere; }
.kk-file.miss { color: var(--text); }
.kk-file em { color: var(--warn); font-style: normal; font-size: 12px; }
.kk-empty { padding: 28px 14px; text-align: center; color: var(--muted); list-style: none; }
.kk-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 26px; }
.kk-form { display: grid; gap: 10px; }
.kk-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 6px; }
.kk-files { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.kk-files li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid #f0f2f5; font-size: 12.5px; }
.kk-files label { display: flex; gap: 6px; min-width: 0; }
.kk-files a { overflow-wrap: anywhere; }
.kk-files em { flex: none; color: var(--muted); font-style: normal; }
@media (max-width: 1100px) {
  .kk-split { grid-template-columns: 1fr; }
  .kk-side { position: static; }
}
@media (max-width: 760px) {
  .kk-chat-head { flex-wrap: wrap; }
  .kk-chat-head input { width: 100%; }
}

.kk-setup .f + .f { margin-top: 10px; }
.kk-review-sum { margin: 0 0 12px; }
/* 컨테이너마다 회색 칸으로 묶어 눈에 띄게 */
.kk-case { background: #eef0f3; border: 1px solid #d5dae2; border-left: 4px solid var(--side); border-radius: var(--radius);
  padding: 14px 16px 8px; margin: 14px 0; }
.kk-case .table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.kk-case .kk-chip { background: var(--panel); }
.kk-case .foot-note { margin-bottom: 0; }
.kk-case-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kk-case-head h3 { margin: 0; font-size: 15px; }
.kk-case-head em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 6px; }
.kk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.kk-chip { padding: 4px 10px; border: 1px solid var(--line); border-radius: 20px; font-size: 12.5px; }
.kk-weight { margin: 0 0 10px; }
.kk-ok, .kk-ok a { color: var(--ok); font-weight: 600; }
.kk-no { color: var(--err); font-weight: 600; }
.kk-cars th, .kk-cars td { white-space: nowrap; vertical-align: top; }
.kk-cars td:nth-child(10) { white-space: normal; }
.kk-cars td:last-child { white-space: normal; }
.kk-cars { font-size: 12.5px; }
.kk-cars th, .kk-cars td { padding-left: 6px; padding-right: 6px; }
.kk-cars .num { text-align: right; font-variant-numeric: tabular-nums; }
.kk-cars tbody.kk-warn td { background: #fffbf0; }
.kk-cars tbody.kk-car tr:first-child td { border-bottom: 0; padding-bottom: 2px; }
.kk-cars .kk-car-checks td { padding-top: 0; white-space: normal; }
.kk-cars .kk-car-nc td { border-bottom: 0; padding-top: 2px; padding-bottom: 4px; white-space: normal; }
.kk-nc-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 2px 0; }
.kk-nc-tab { flex: 0 0 58px; font-size: 11px; font-weight: 700; color: var(--muted); }
.kk-nc { padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: 12px;
  color: var(--muted); cursor: pointer; white-space: nowrap; }
.kk-nc b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.kk-nc em { font-style: normal; font-size: 11px; }
.kk-nc:hover, .kk-nc:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.kk-nc.none { cursor: default; border-style: dashed; background: none; }
.kk-check { display: inline-block; margin: 0 14px 2px 0; font-size: 12px; color: var(--muted); }
.kk-err { flex: none; max-width: 340px; font-size: 12px; color: var(--err); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kk-vin { font-size: 12px; color: var(--muted); }
.kk-issues { margin: 8px 0; padding-left: 18px; color: var(--err); }
.kk-info { margin: 0 0 10px; color: var(--muted); font-size: 13px; }

/* 오른쪽 대화칸은 훑어보기용으로 작게 */
.kk-chat-head { flex-wrap: wrap; padding: 8px 10px; gap: 6px; }
.kk-chat-head input { width: 100%; }
.kk-chat .kk-msg { padding: 3px 10px 3px 8px; }
.kk-chat .kk-who { font-size: 11.5px; color: var(--muted); }
.kk-chat .kk-who b { color: var(--text); }
.kk-chat .kk-text, .kk-chat .kk-file { margin-left: 0; }
.kk-chat .kk-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kk-chat .kk-day { padding: 6px 0 2px; font-size: 11.5px; }
.kk-side .kk-files { max-height: 180px; }

.kk-recheck { margin-left: 6px; padding: 1px 8px; font: inherit; font-size: 11.5px; color: var(--accent);
  background: var(--panel); border: 1px solid #c9d1dd; border-radius: 12px; cursor: pointer; }
.kk-recheck:hover { border-color: var(--accent); }
.kk-recheck:disabled { color: var(--muted); cursor: default; }
.kk-sub-in { font-style: normal; color: var(--muted); font-size: 11.5px; }
.kk-err-line { flex-basis: 100%; font-size: 12px; color: var(--err); }

/* 카톡 검토표 사진·서류 보기 팝업 */
.modal.modal-wide { width: min(1100px, calc(100vw - 40px)); }
.kk-viewer figure { margin: 0 0 16px; }
.kk-zoom { height: calc(100vh - 230px); overflow: auto; text-align: center; background: #f3f4f6; border-radius: 6px; cursor: grab; }
.kk-zoom.grab { cursor: grabbing; }
.kk-rot { position: relative; display: inline-block; vertical-align: top; }
.kk-viewer .kk-rot img { position: absolute; left: 0; top: 0; max-width: none; user-select: none; transform-origin: center; }
.kk-viewer iframe { display: block; width: 100%; height: calc(100vh - 220px); border: 1px solid var(--line); border-radius: 6px; }
.kk-viewer figcaption { margin-top: 6px; font-size: 12px; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.kk-case.kk-roro { border-left-color: var(--gold); }
.kk-roro .kk-case-head h3 span { margin-left: 4px; }

/* 검토표: 컨테이너·RORO 표의 칸 폭을 모두 같게 */
.kk-cars { table-layout: fixed; width: 100%; }
.kk-cars .c-chk { width: 36px; } .kk-cars .c-exp { width: 8.5%; } .kk-cars .c-dest { width: 10%; }
.kk-cars .c-car { width: 14%; } .kk-cars .c-made { width: 5%; } .kk-cars .c-vin { width: 14%; }
.kk-cars .c-kg { width: 6.5%; } .kk-cars .c-amt { width: 7.5%; } .kk-cars .c-cur { width: 4.5%; } .kk-cars .c-dcl { width: 14%; }
/* 신고 · 필증 칸: 수리 → 필증 → 카톡 회신 */
.kk-cars td.kk-dcl { white-space: normal; }
.kk-dcl .kk-sub-in.mono { display: block; font-size: 11px; }
.kk-send { margin-top: 3px; }
.kk-send .kk-recheck { margin-left: 0; }
.kk-cars th, .kk-cars td { overflow: hidden; text-overflow: ellipsis; }
.kk-cars td:nth-child(2), .kk-cars td:nth-child(3), .kk-cars td:nth-child(4) { white-space: normal; }
.kk-cars .kk-car-checks td { white-space: normal; }

/* 대화방 목록: 제목 줄을 두고 줄을 크게, 고른 방은 남색 바탕 */
.kk-rooms-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--side); color: #fff;
  border-radius: var(--radius) var(--radius) 0 0; }
.kk-rooms-head img { width: 22px; height: 22px; }
.kk-rooms-head h2 { margin: 0; font-size: 15px; }
.kk-rooms-head span { font-size: 12.5px; color: #c9d2de; }
.kk-rooms-head b { color: var(--gold); font-weight: 600; }
.kk-rooms { border-radius: 0; border-top: 0; }
.kk-room { padding: 8px 14px 8px 0; border-left-width: 5px; }
.kk-room-name { font-size: 15px; padding: 8px 16px; }
.kk-room.on { background: #eef2f8; border-left-color: var(--side); }
.kk-room.on .kk-room-name { color: var(--side); font-weight: 700; }
.kk-room.hot { border-left-color: var(--gold); background: #fff8e1; }
.kk-read { padding: 6px 16px; font-size: 13px; font-weight: 600; }
/* 목적국과 차량·연식 사이를 띄워 구분 */
.kk-cars thead th:nth-child(4), .kk-cars tbody tr:first-child td:nth-child(4) { padding-left: 22px; }
.kk-head-btns { display: inline-flex; gap: 6px; }

.kk-unipass { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; }
.kk-unipass em { font-style: normal; color: var(--muted); font-size: 12px; }
.kk-unipass-help { flex-basis: 100%; font-size: 12px; color: var(--muted); }

/* Outlook 연동: [접수] 한 번 단추(아래 세 단추를 따로 누르지 않게) */
.mail-top-acts { display: flex; gap: 8px; margin: 12px 0 8px; }
.mail-intake.alt { flex: 0 1 44%; background: #fff; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.mail-intake.alt em { color: var(--muted); }
.iq-block { margin: 10px 0; font-size: 13px; }
.iq-block h4 { margin: 0 0 4px; font-size: 12.5px; }
.iq-block h4 em { font-style: normal; font-weight: 400; color: var(--muted); }
.iq-block ul { margin: 0; padding-left: 18px; }
.iq-draft { margin: 0; padding: 12px 14px; white-space: pre-wrap; font: inherit; background: #f6f7f9; border-radius: 8px; }
.mail-intake { display: flex; align-items: baseline; gap: 10px; flex: 1; padding: 11px 16px;
  border: 0; border-radius: 10px; background: var(--side); color: #fff; font: inherit; cursor: pointer; text-align: left; }
.mail-intake b { font-size: 14.5px; white-space: nowrap; }
.mail-intake em { font-style: normal; font-size: 12px; color: #c9d2de; }
.mail-intake:hover { filter: brightness(1.15); }

/* ===== 서류검토: HS · 요건 조회 ===== */
.rv-form { display: flex; gap: 10px; align-items: center; }
.rv-form input { flex: 1; max-width: 560px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 14px; }
.rv-form input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.rv-grid { display: grid; grid-template-columns: minmax(300px, 2fr) 3fr; gap: 16px; align-items: start; }
.rv-grid .card { margin-bottom: 16px; }
.rv-empty { margin: 0; color: var(--muted); font-size: 13px; }
.rv-list { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow-y: auto; }
.rv-hs { display: grid; grid-template-columns: 104px 1fr auto; gap: 8px; align-items: baseline; width: 100%; padding: 8px 10px; border: 0;
  border-bottom: 1px solid var(--line); background: none; font: inherit; font-size: 13px; text-align: left; color: var(--text); cursor: pointer; }
.rv-hs:hover { background: #f5f7fa; }
.rv-hs.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.rv-hs em, .rv-h em, .rv-case summary em { font-style: normal; color: var(--muted); font-size: 12px; }
.rv-h { margin: 0 0 2px; font-size: 16px; }
.rv-meta { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; }
.rv-rates { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.rv-rate { padding: 8px 14px; border-radius: 10px; background: #f3f5f8; }
.rv-rate span { display: block; font-size: 11.5px; color: var(--muted); }
.rv-rate b { font-size: 16px; font-variant-numeric: tabular-nums; }
.rv-fta { margin-bottom: 10px; font-size: 12.5px; }
.rv-fta summary, .rv-case summary { cursor: pointer; }
.rv-fta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 3px 14px; margin-top: 6px; }
.rv-fta-grid b { font-variant-numeric: tabular-nums; }
.rv-req h4, .rv-case h4 { margin: 10px 0 3px; font-size: 12.5px; }
.rv-req p, .rv-case p { margin: 0; font-size: 13px; line-height: 1.65; }
.rv-case { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
@media (max-width: 1000px) { .rv-grid { grid-template-columns: 1fr; } }

/* 서류검토: 서류에서 품목 읽기 */
.rv-drop { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border: 1.5px dashed var(--line);
  border-radius: 10px; font-size: 12.5px; color: var(--muted); }
.rv-drop.over { border-color: var(--accent); background: var(--accent-soft); }
#rv-items { margin-top: 10px; }
.rv-items td { vertical-align: middle; }
.rv-items .right { text-align: right; font-variant-numeric: tabular-nums; }

/* 서류검토: 서류 대조 · 검토표 · 과세가격 */
.rv-docs { margin: 12px 0 2px; display: flex; flex-wrap: wrap; gap: 5px; }
.rv-sec { margin: 16px 0 6px; font-size: 14px; }
.rv-sec em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 6px; }
.rv-chks { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; }
.rv-chk { padding: 7px 11px; border-radius: 8px; background: #f3f5f8; font-size: 12.8px; }
.rv-chk.bad { background: var(--err-soft); }
.rv-chk em { font-style: normal; color: var(--muted); font-size: 11.5px; }
.tag.err { background: var(--err-soft); color: var(--err); }
.rv-sheet th { width: 190px; text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.rv-sheet td, .rv-sheet th { padding: 6px 8px; vertical-align: middle; }
.rv-docs .btn { margin-left: 6px; }
.rv-todo { margin: 0; padding: 8px 12px 8px 28px; border-radius: 8px; background: var(--warn-soft, #fff6e0); font-size: 12.8px; line-height: 1.7; }
.rv-fta-grid .rv-fta-pick { padding: 2px 6px; margin: -2px -6px; border: 0; border-radius: 6px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.rv-fta-grid .rv-fta-pick:hover, .rv-fta-grid .rv-fta-pick:focus-visible { background: var(--accent-soft); }
@media print {
  body.rv-print .sidebar, body.rv-print .page-head, body.rv-print .rv-form, body.rv-print .rv-drop, body.rv-print .rv-grid,
  body.rv-print #page-review > .card ~ .card, body.rv-print .btn, body.rv-print .toast { display: none !important; }
  body.rv-print, body.rv-print .content, body.rv-print #page-review .card { background: #fff !important; box-shadow: none !important; border: 0 !important; padding: 0 !important; }
  body.rv-print .rv-items input { border: 0; }
}
.rv-sheet .rv-tab th { width: auto; padding: 7px 10px; background: #f3f5f8; color: var(--text); font-weight: 600; }
.rv-v { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.rv-calc { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.rv-calc label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.rv-calc input, .rv-rate-in { width: 130px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px;
  font-variant-numeric: tabular-nums; text-align: right; }
.rv-rate-in { width: 70px; }
.rv-total { flex-basis: 100%; padding: 9px 13px; border-radius: 10px; background: #f3f5f8; font-size: 13px; }
.rv-total b { font-size: 15px; font-variant-numeric: tabular-nums; margin-right: 8px; }
.rv-picked { margin-top: 2px; font-size: 12px; }
.rv-apply { margin-bottom: 8px; }
