:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e4e8ed;
  --text: #1e293b;
  --muted: #64748b;
  --side: #0f1b33;
  --side-2: #18264a;
  --side-text: #cbd5e1;
  --accent: #2563eb;
  --accent-soft: #e8efff;
  --red: #dc2626;
  --red-soft: #fde8e8;
  --yellow-soft: #fff5d6;
  --green: #15803d;
  --green-soft: #def7e5;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  font-size: 13px; color: var(--text); background: var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ── 로그인 ── */
.auth { min-height: 100%; display: grid; place-items: center; background: linear-gradient(160deg, #0f1b33, #1e3a8a); padding: 16px; }
.auth-card { width: 100%; max-width: 360px; background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.auth-card h1 { margin: 10px 0 4px; font-size: 20px; }
.auth-card p { margin: 0 0 18px; color: var(--muted); }
.auth-card label { display: block; margin: 10px 0 4px; font-weight: 600; }
.auth-card input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; }
.auth-card .btn { width: 100%; height: 40px; margin-top: 18px; }
.auth-err { color: var(--red); min-height: 18px; margin-top: 10px; }

/* ── 틀 ── */
.shell { display: flex; height: 100%; }
.side { width: 240px; flex: none; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; transition: margin .15s; }
.shell.collapsed .side { margin-left: -240px; }
.brand { display: flex; gap: 10px; align-items: center; padding: 16px 18px; background: #fff; color: var(--text); border-right: 1px solid var(--line); height: 56px; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; background: var(--side); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.brand b { display: block; font-size: 15px; }
.brand small { color: var(--muted); font-size: 11px; }
.side-search { padding: 12px 14px 6px; }
.side-search input { width: 100%; height: 34px; border-radius: 8px; border: 1px solid #2a3a63; background: var(--side-2); color: #fff; padding: 0 10px; }
.side-search input::placeholder { color: #7b8bb0; }
nav { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; color: var(--side-text); border-radius: 8px; text-align: left; }
.nav-item:hover { background: var(--side-2); color: #fff; }
.nav-item.active { background: #24345f; color: #fff; font-weight: 700; }
.nav-cat { margin-top: 10px; }
.nav-cat-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: #e2e8f0; font-weight: 600; }
.nav-cat-icon { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-size: 12px; flex: none; }
.nav-cat .nav-item { padding-left: 44px; font-size: 12.5px; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; line-height: 18px; }
.side-foot { padding: 12px 14px; border-top: 1px solid #22305a; font-size: 11.5px; color: #7b8bb0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 56px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--line); }
.crumb { color: var(--muted); }
.crumb b { color: var(--text); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.today { color: var(--muted); }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; height: 32px; min-width: 32px; padding: 0 8px; }
.icon-btn:hover { background: var(--bg); }
.user-btn { border: 1px solid var(--line); background: #fff; border-radius: 18px; height: 32px; padding: 0 12px; font-weight: 600; }
.page { flex: 1; overflow: auto; padding: 22px 24px 40px; }

/* ── 공통 ── */
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 20px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; height: 34px; padding: 0 14px; font-weight: 600; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { color: var(--red); border-color: #f3b4b4; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.card-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.card-head .more { margin-left: auto; font-weight: 500; font-size: 12px; color: var(--accent); background: none; border: 0; }
.card-body { padding: 14px 16px; }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; }
.badge { display: inline-block; border-radius: 6px; padding: 1px 7px; font-size: 11.5px; font-weight: 600; background: #eef1f5; color: #475569; white-space: nowrap; }
.badge.red { background: var(--red-soft); color: #b91c1c; }
.badge.yellow { background: var(--yellow-soft); color: #92400e; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.blue { background: var(--accent-soft); color: #1d4ed8; }
.badge.gray { background: #f1f3f6; color: #94a3b8; }
.up { color: var(--green); font-weight: 700; }
.down { color: var(--red); font-weight: 700; }
.help { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ── 대시보드 ── */
.dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dash .span2 { grid-column: span 2; }
.dash .span3 { grid-column: 1 / -1; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; }
.kpi:hover { border-color: #b8c6dc; }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 24px; font-weight: 800; margin-top: 4px; }
.kpi.alert .value { color: var(--red); }
.mini { width: 100%; border-collapse: collapse; }
.mini th, .mini td { padding: 8px 6px; border-bottom: 1px solid #eef1f4; text-align: left; }
.mini th { color: var(--muted); font-weight: 600; font-size: 12px; }
.mini td.num, .mini th.num { text-align: right; }
.mini tr:last-child td { border-bottom: 0; }
.bar { height: 8px; background: #eef1f5; border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: #f59e0b; }
.bar.red > i { background: #ef4444; }
/* 대시보드: 마켓별 상세페이지 점검 카드 */
.dd-rate { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 13px; color: #475569; }
.dd-rate > b { font-size: 20px; color: #0f172a; }
.dd-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 4px; font-size: 12px; color: #64748b; }
.dd-nums b { color: #0f172a; }
.dd-sub { margin: 12px 0 4px; font-size: 12px; font-weight: 700; color: #475569; }
.dd-cols { display: flex; flex-wrap: wrap; gap: 6px; }
.mini td.nowrap { white-space: nowrap; }
.dd-note { margin-top: 2px; font-size: 11px; color: #b45309; }
/* 상품코드 칸: 클릭하면 복사 */
td.copy-code { cursor: copy; white-space: nowrap; }
td.copy-code .cc-ico { margin-left: 6px; font-size: 11px; opacity: 0; transition: opacity .12s; }
td.copy-code:hover { color: #1d4ed8; text-decoration: underline dotted; text-underline-offset: 3px; }
td.copy-code:hover .cc-ico { opacity: .75; }
td.copy-code.copied { background: #dbeafe !important; color: #1d4ed8; font-weight: 700; }
.mytask { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid #eef1f4; }
.mytask:last-child { border-bottom: 0; }
.mytask .t { flex: 1; }
.check { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* ── 표 ── */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input, .toolbar select { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; }
.toolbar input[type=search] { width: 220px; }
.toolbar .count { margin-left: auto; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; height: 32px; padding: 0 12px; }
.seg button.on { background: var(--side); color: #fff; font-weight: 600; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 210px); }
table.grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.grid th { position: sticky; top: 0; z-index: 1; background: #f8fafc; color: #475569; font-weight: 700; font-size: 12px; text-align: center; padding: 9px 8px; border-bottom: 1px solid var(--line); border-right: 1px solid #eef1f4; white-space: nowrap; }
.grid td { padding: 8px; border-bottom: 1px solid #eef1f4; border-right: 1px solid #f3f5f8; vertical-align: top; max-width: 460px; }
.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid td.center { text-align: center; }
.grid td.wrap { white-space: pre-wrap; word-break: break-word; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover td { background: #f7faff; }
.grid tr.row-red td { background: #fff4f4; }
.grid tr.row-yellow td { background: #fffbea; }
.grid tr.row-done td { color: #9aa5b5; }
.grid a { color: var(--accent); }
/* 항목 열 설정: 오른쪽 서랍 창, 열 제목 2줄 */
.modal.drawer { place-items: stretch end; padding: 12px; }
.modal.drawer .modal-box { max-width: 360px; height: calc(100vh - 24px); max-height: none; }
.modal.drawer .modal-head h3 { font-size: 20px; }
.colcfg label { display: block; font-size: 13px; color: #475569; margin: 14px 0 6px; }
.colcfg label:first-child { margin-top: 0; }
.colcfg select, .colcfg input, .colcfg textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; box-sizing: border-box; }
.colcfg textarea { resize: none; }
.colcfg .hint { font-size: 12px; color: #64748b; margin-top: 6px; line-height: 1.5; }
.cc-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cc-colors button { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.cc-colors button.on { border: 2px solid #6366f1; background: #eef2ff; padding: 6px 7px; }
.cc-colors .sw { width: 22px; height: 16px; border: 1px solid #cbd5e1; border-radius: 4px; flex: none; }
.th-title { white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grid th.th-click { cursor: pointer; }
.grid th.th-click:hover { filter: brightness(.96); }

/* 마케팅 체크리스트 판매처 선택 */
.market-seg .market-find { width: 120px; margin: 0 4px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13px; background: #fff; }
.market-seg .market-find:focus { outline: 2px solid var(--accent); border-color: transparent; }
.seg.market-seg { overflow: visible; }  /* 판매처 목록이 블록 밖으로 펼쳐지게 */
.seg.market-seg > button:last-child { border-radius: 0 8px 8px 0; }
.market-find-wrap { position: relative; display: inline-flex; align-items: center; }
.market-find { cursor: pointer; }
.market-drop { position: absolute; top: calc(100% + 6px); left: 4px; z-index: 30; min-width: 220px; max-height: 300px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(15, 23, 42, .15); padding: 4px; }
.market-drop[hidden] { display: none; }
.md-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.md-item:hover, .md-item.hi { background: #eef2ff; }
.md-item.cur b { color: #2563eb; }
.md-item.cur b::after { content: ' ✓'; }
.md-meta { font-size: 12px; color: #64748b; white-space: nowrap; }
.md-none { padding: 10px; font-size: 13px; color: #94a3b8; }
.item-check-btn { font-weight: 700; color: #1e2a4a; border-color: #94a3b8; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-check-btn.picked { background: #eef2ff; border-color: #6366f1; color: #3730a3; }
/* 품목점검 창: 넓게 */
.modal.wide .modal-box { max-width: 1100px; }
.ic-add { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.ic-find-wrap { position: relative; flex: 1; min-width: 260px; }
.ic-find-wrap input { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; }
.ic-find-wrap .market-drop { left: 0; right: 0; min-width: 0; max-height: 320px; overflow: auto; }
.ic-table { max-height: 55vh; overflow: auto; }
.ic-table tbody tr { cursor: pointer; }
.ic-table tr.ic-sel td { background: #eef2ff !important; font-weight: 600; }
.import-btn { color: #1d4ed8; border-color: #93c5fd; font-weight: 600; }
.ic-add select { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: inherit; background: #fff; }
.im-all { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; cursor: pointer; }
.ic-table tr.im-have td { color: #9aa5b5; cursor: default; }
.im-tag { font-size: 11px; color: #64748b; background: #f1f5f9; border-radius: 4px; padding: 1px 5px; margin-left: 4px; }
.ic-memo { width: 100%; min-width: 100px; padding: 4px 6px; border: 1px solid #e2e8f0; border-radius: 6px; font: inherit; }
.md-add { margin-top: 4px; padding: 9px 10px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; color: #2563eb; cursor: pointer; border-radius: 0 0 6px 6px; }
.md-add:hover { background: #eff6ff; }
.mini-badge { display: inline-block; min-width: 16px; padding: 0 5px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; line-height: 16px; text-align: center; margin-left: 2px; }
.h2-market { color: #2563eb; }
.market-line { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.market-line input { padding: 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; min-width: 0; }
.market-line .muted { font-size: 12px; color: #64748b; }
.copy-box { background: #f0f5ff; border: 1px solid #c7d7f5; border-radius: 12px; padding: 16px; margin-bottom: 12px; color: #334155; line-height: 1.6; }
.copy-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* 재고 자료 */
.muted { color: #94a3b8; }
.inv-upload { margin-bottom: 16px; }
.inv-upload[hidden] { display: none; }
.inv-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; border: 2px dashed #c7d2fe; border-radius: 14px;
  background: #f8faff; cursor: pointer; text-align: center; transition: background .15s, border-color .15s; }
.inv-drop:hover, .inv-drop.over { background: #eef2ff; border-color: #6366f1; }
.inv-drop b { font-size: 15px; color: #3730a3; }
.inv-drop span { font-size: 12px; color: #64748b; }
.inv-map { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.inv-map-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.inv-map-head span { color: #64748b; font-size: 13px; flex: 1; }
.inv-map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 12px; margin-bottom: 12px; }
.inv-map-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #475569; font-weight: 600; }
.inv-map-grid em { color: #dc2626; font-style: normal; font-weight: 500; }
.inv-map-grid select, .inv-map-grid input { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: inherit; font-weight: 400; color: #1e293b; }
.inv-preview { max-height: 300px; }
.inv-preview th[data-tag]:not([data-tag=""])::after { content: ' → ' attr(data-tag); font-weight: 800; }
.inv-preview .map-name { background: #dbeafe !important; }
.inv-preview .map-qty { background: #dcfce7 !important; }
.inv-preview .map-code { background: #fef9c3 !important; }
.inv-preview .map-location { background: #ede9fe !important; }
.inv-preview .map-spec { background: #fde2e4 !important; }
.inv-preview .map-grp { background: #e2e8f0 !important; }
.inv-map-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 12px; }
.inv-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.inv-stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.inv-stat small { font-size: 12px; color: #64748b; }
.inv-stat b { font-size: 22px; color: #0f172a; }
.inv-stat span { font-size: 11px; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-stat[data-pick] { cursor: pointer; }
.inv-stat.warn b { color: #b45309; }
.inv-stat.bad b { color: #dc2626; }
.inv-stat[data-pick]:hover { border-color: #94a3b8; }
.inv-low { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; }
.inv-low input { width: 64px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: inherit; text-align: right; }
.inv-h3 { margin: 22px 0 10px; font-size: 15px; }

/* MARKETING TOOLS 버튼 (체크리스트 제목 옆 → Marketing Tools 페이지) */
.mt-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 800; letter-spacing: .09em; color: #fff;
  background: linear-gradient(120deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%); background-size: 200% 100%;
  box-shadow: 0 4px 14px rgba(124, 58, 237, .35), inset 0 1px 0 rgba(255,255,255,.25); transition: background-position .4s, transform .15s, box-shadow .2s; }
.mt-btn:hover { background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(219, 39, 119, .35), inset 0 1px 0 rgba(255,255,255,.25); }
.mt-spark { font-size: 13px; filter: drop-shadow(0 0 4px rgba(255, 230, 120, .9)); }
.mt-caret { font-size: 14px; opacity: .85; }
.mt-count { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #6d28d9; background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }

/* Marketing Tools 페이지: 4열 링크 칸 표 */
.tools-title { letter-spacing: .08em; background: linear-gradient(90deg, #4f46e5, #7c3aed 55%, #db2777); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tools-title .mt-spark { -webkit-text-fill-color: initial; }
.tools-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 12px; box-shadow: 0 1px 3px rgba(15,23,42,.04); }
.tools-add { border: 0; background: none; color: #475569; font: inherit; font-size: 13px; padding: 4px 4px 8px; cursor: pointer; }
.tools-add:hover { color: var(--accent); }
.tools-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tools-grid td { height: 41px; border: 1px solid #dbe4f0; padding: 0 10px; font-size: 14px; color: #1e293b; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools-grid td:not(.filled):hover { background: #f8fafc; box-shadow: inset 0 0 0 2px #c7d2fe; }
.tools-grid td.filled:hover { box-shadow: inset 0 0 0 2px #7c3aed; }
.tools-grid td.filled { cursor: grab; user-select: none; touch-action: none; }
.tl-ghost { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; display: flex; align-items: center; padding: 0 10px;
  font-size: 14px; color: #1e293b; white-space: nowrap; overflow: hidden; border: 1px solid #7c3aed; border-radius: 8px;
  box-shadow: 0 12px 28px rgba(76, 29, 149, .25); opacity: .95; }
body.tl-dragging, body.tl-dragging * { cursor: grabbing !important; user-select: none; }
.tools-grid td.dragging { opacity: .35; }
.tools-grid td.drop-over { background: #ede9fe !important; box-shadow: inset 0 0 0 2px #7c3aed, 0 0 0 1px #7c3aed; }
.tools-grid td.just-moved { animation: tl-pop .5s ease; }
@keyframes tl-pop { 0% { box-shadow: inset 0 0 0 3px #a78bfa; transform: scale(.97); } 100% { box-shadow: none; transform: none; } }
.tl-ico { color: #94a3b8; font-size: 11px; margin-right: 5px; }
.tools-foot { margin-top: 10px; font-size: 12px; color: #64748b; }
.cell-menu { position: fixed; z-index: 60; min-width: 170px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .18); }
.cell-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.cell-menu button:hover { background: #f1f5f9; }
.cell-menu button.danger { color: #dc2626; }
.cell-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* 체크리스트 제목 옆 바로가기 링크 */
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.quick-links { display: flex; gap: 6px; flex-wrap: wrap; }
.qlink { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 999px; border: 1px solid #c7d7f5; background: #f0f5ff;
  color: #1d4ed8; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; font-family: inherit; }
.qlink:hover { background: #dfeaff; }
.qlink.edit { background: #fff; border: 1px solid #94a3b8; color: #334155; font-weight: 600; }
.qlink.edit:hover { background: #f1f5f9; border-color: #475569; }
.qlink-wrap { position: relative; display: inline-flex; }
.qlink-wrap .qlink { padding-right: 11px; transition: padding .12s; }
.qlink-wrap:hover .qlink { padding-right: 30px; }
.ql-pen { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: #fff; color: #1d4ed8; font-size: 12px; cursor: pointer; display: none; box-shadow: 0 1px 3px rgba(15,23,42,.2); }
.qlink-wrap:hover .ql-pen { display: block; }
.ql-pen:hover { background: #1d4ed8; color: #fff; }
.link-line { display: grid; grid-template-columns: 1fr 2fr auto; gap: 6px; margin-bottom: 6px; }
.link-line input { padding: 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; min-width: 0; }
/* 체크리스트: 표에서 바로 쓰는 담당자 칸, 담당자 미정 묶음 줄 */
/* 입력칸 글자는 칸(td)의 정렬을 따른다 — 열 설정의 '내용 정렬'이 담당자 이름에도 적용되게 */
.who-input { width: 100%; text-align: inherit; padding: 4px 6px; border: 1px dashed #c7d0dc; border-radius: 6px; font: inherit; background: #fff; color: #1e293b; }
.who-input:not(:placeholder-shown) { border-style: solid; border-color: #94a3b8; font-weight: 600; }
/* 이름 자동완성(datalist) 화살표는 숨긴다 — 화살표 자리만큼 이름이 왼쪽으로 쏠려 보여서. 글자를 치면 목록은 그대로 나온다 */
.who-input::-webkit-calendar-picker-indicator { display: none !important; }
.who-input:focus { outline: 2px solid var(--accent); border-color: transparent; }
/* 마케팅 체크리스트 표: 제목 줄 남색(왼쪽 메뉴 색)·흰 글씨, 내용 줄은 상태와 관계없이 흰 바탕(상태는 '결과' 글자색으로 구분) */
/* 2026-10-28 사용자 요청: 남색은 왼쪽 메뉴와 겹쳐 어둡고, 진한 파랑은 버튼들과 부딪혀서
   연한 바탕 + 진한 같은 계열 글씨 + 아래 굵은 선. 사용자가 고른 색 B07 #94B0E9 (글씨는 남색이 흰색보다 잘 읽힘) */
.grid.check-grid th { background: #94b0e9; color: #1e2a4a; border-right-color: #a9c0ee; border-bottom: 2px solid #6b8fdc; }
.grid.check-grid tr.row-red td, .grid.check-grid tr.row-yellow td { background: #fff; }
.grid.check-grid tbody tr:not(.group-row):hover td { background: #f7faff; }
.grid tr.group-row td { background: #eef2f7; font-weight: 700; color: #334155; padding: 10px 12px; }
.grid tr.group-row:hover td { background: #e4e9f1; }
.grid tr.group-row .muted { font-weight: 400; color: #64748b; }

/* ── 입력창 ── */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-box { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; flex: 1; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal-foot .spacer { flex: 1; }
.form-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: start; margin-bottom: 10px; }
.form-row > label { padding-top: 8px; font-weight: 600; color: #334155; }
.form-row .req { color: var(--red); }
.form-row input, .form-row select, .form-row textarea { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; }
.form-row textarea { height: 72px; padding: 8px 10px; resize: vertical; }
.form-row .ro { padding-top: 8px; color: var(--muted); }
.form-err { color: var(--red); min-height: 18px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.2); }

@media (max-width: 1100px) {
  .dash { grid-template-columns: 1fr; }
  .dash .span2 { grid-column: auto; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .side { position: fixed; z-index: 40; height: 100%; }
  .shell:not(.open) .side { margin-left: -240px; }
  .page { padding: 16px; }
  .today { display: none; }
  .toolbar input[type=search] { width: 100%; }
  .form-row { grid-template-columns: 1fr; gap: 4px; }
  .form-row > label { padding-top: 0; }
}

/* 마켓별 상세페이지: 왼쪽 품목 칸·제목 줄 고정, 칸 색 = 점검 상태 */
.dp-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.dp-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 12px; }
.dp-chip b { color: #0f172a; }
.dp-chip.ok { background: #e0f2fe; color: #075985; }
.dp-chip.warn { background: #fef3c7; color: #92400e; }
.dp-chip.bad { background: #fee2e2; color: #b91c1c; }
.dp-wrap { max-height: calc(100vh - 250px); }
.dp-grid { border-collapse: separate; border-spacing: 0; }
.dp-grid th { vertical-align: middle; }
.dp-grid th.dp-stick { z-index: 3; }
.dp-grid td.dp-stick { position: sticky; z-index: 1; background: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.dp-grid .dp-edge { box-shadow: 2px 0 0 #c7d2e4; }
.dp-grid th.dp-col { min-width: 74px; width: 74px; padding: 6px 4px; line-height: 1.25; }
.dp-grid th .dp-t2 { font-weight: 500; font-size: 11px; opacity: .85; }
.dp-grid th .dp-who { font-weight: 500; font-size: 10px; color: #4338ca; }
.dp-grid td.dp-cell { text-align: center; vertical-align: middle; cursor: pointer; position: relative; padding: 6px 2px; font-size: 12px; white-space: nowrap; user-select: none; }
.dp-grid td.dp-cell:hover { outline: 2px solid #93c5fd; outline-offset: -2px; }
.dp-grid td.dp-link { background: #f0f7ff; }
.dp-grid td.dp-good { background: #dcfce7; }
.dp-grid td.dp-bad { background: #fee2e2; }
.dp-grid td.dp-off { background: #f1f5f9; color: #94a3b8; }
.dp-grid td.dp-sel { outline: 2px solid #2563eb; outline-offset: -2px; }
.dp-no { font-size: 10px; color: #475569; margin-left: 2px; font-variant-numeric: tabular-nums; }
.dp-badn { position: absolute; top: 2px; right: 3px; min-width: 14px; height: 14px; border-radius: 7px; background: #dc2626; color: #fff; font-size: 10px; line-height: 14px; padding: 0 3px; }
.dp-memo { position: absolute; bottom: 3px; right: 3px; width: 6px; height: 6px; border-radius: 3px; background: #f59e0b; }
.dp-short { color: #b45309; font-weight: 700; }
.dp-full { color: #15803d; font-weight: 700; }
.dp-checks { width: 100%; border-collapse: collapse; margin: 8px 0 12px; }
.dp-checks td { padding: 6px 4px; border-bottom: 1px solid #eef1f4; }
.dp-checks td.dp-res { text-align: right; white-space: nowrap; width: 1%; }
.dp-checks td.dp-ck { white-space: nowrap; width: 1%; padding-right: 10px; }
.dp-checks td { vertical-align: middle; }
.dp-notebox { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 4px 8px; border: 1px dashed #cbd5e1; border-radius: 6px;
  background: #fff; font: inherit; font-size: 13px; text-align: left; cursor: pointer; color: #334155; }
.dp-notebox:hover { border-color: #3b82f6; background: #f8fbff; }
.dp-notebox.has { border-style: solid; border-color: #fcd34d; background: #fffbeb; }
.dp-notebox .nb-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-notebox .nb-cnt { flex: none; font-size: 11px; color: #92400e; }
.dp-prog { display: block; color: #1d4ed8; white-space: pre-wrap; }
.dp-donecnt { margin-top: 6px; font-size: 12px; }
/* 메모 기록 창 (점검 창 위 한 겹 더) */
.sub-modal { position: fixed; inset: 0; z-index: 55; background: rgba(15, 23, 42, .35); display: grid; place-items: center; padding: 16px; }
.sub-box { background: #fff; border-radius: 14px; width: 100%; max-width: 1080px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.sub-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sub-body { padding: 14px 18px 18px; overflow: auto; }
.nl-new { border: 1px solid #bfdbfe; background: #f5f9ff; border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.nl-new label { display: block; font-size: 12px; font-weight: 700; color: #475569; margin: 0 0 4px; }
.nl-new-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.nl-new-row label { margin: 0; }
.nl-new-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.nl-new textarea, .nl-table textarea { width: 100%; font: inherit; font-size: 13px; line-height: 1.45; resize: vertical; }
.nl-sec { margin: 6px 0; font-size: 13px; font-weight: 700; color: #334155; }
.nl-sec.done { margin-top: 16px; color: #64748b; }
.nl-table { width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.nl-table th { position: static; }
.nl-table td { vertical-align: top; }
.nl-table textarea { border: 1px solid transparent; background: transparent; padding: 4px 6px; border-radius: 6px; overflow: hidden; }
.nl-table textarea:hover, .nl-table textarea:focus { border-color: #cbd5e1; background: #fff; }
.nl-table input[type=date] { border: 1px solid transparent; background: transparent; font: inherit; font-size: 12px; }
.nl-table input[type=date]:hover { border-color: #cbd5e1; }
.nl-table tr.nl-done td { background: #f8fafc; color: #94a3b8; }
.nl-table tr.nl-done textarea { color: #94a3b8; text-decoration: line-through; text-decoration-color: #cbd5e1; }
.nl-dt { font-size: 10px; }
@media (max-width: 760px) { .nl-new-grid { grid-template-columns: 1fr; } }
.dp-line span:last-child { white-space: pre-wrap; word-break: break-word; }
.modal.mid .modal-box { max-width: 820px; }
.dp-allnotes { border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; padding: 8px 10px; max-height: 180px; overflow: auto; margin: 6px 0 12px; font-size: 13px; }
.dp-line { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
.dp-line b { white-space: nowrap; }
.dp-tag { flex: none; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #e2e8f0; color: #475569; }
.dp-tag.bad { background: #fee2e2; color: #b91c1c; }
.dp-tag.ok { background: #dcfce7; color: #15803d; }
.dp-checks .seg button.on { background: #16a34a; color: #fff; }
.dp-checks .seg button.bad.on { background: #dc2626; color: #fff; }
.dp-checks .seg button.none.on { background: #e2e8f0; color: #475569; }
.dc-wrap { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
.dc-wrap input { width: 100%; }
.dc-wrap td.nowrap { white-space: nowrap; }
.dc-wrap textarea { width: 100%; margin-top: 6px; }
@media (max-width: 760px) { .dc-wrap { grid-template-columns: 1fr; } }
