/* =====================================================================
   다온가 유통 — 메타포 화면 (도크 안내판 · 랙 평면도 · 유통기한 라벨 · 노선도 · 장부 · 박스 칸반 · 명세표)
   공용 스킨(Ops·Control) 변수 위에서 동작. 유통 전용 테마(U-A·U-B·U-C)는 시안 수령 후 교체
   ===================================================================== */
:root { --amb: #d99a2b; --chill: #2f7fd8; --frozen: #4b4fc9; }
.d-temp { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; white-space: nowrap; }
.d-temp i { width: 8px; height: 8px; border-radius: 2px; }
.d-chip { display: inline-block; font-size: 10px; padding: 1px 7px; border-radius: 9px; border: 1px solid var(--line); color: var(--mute); }
.d-bar { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; } .d-bar i { display: block; height: 100%; background: var(--ac); }
.d-bar.warn i { background: var(--warn); } .d-bar.risk i { background: var(--risk); }
.d-row { display: grid; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 12px; }
.d-row:last-child { border-bottom: 0; }
.d-seg { display: flex; gap: 4px; flex-wrap: wrap; } .d-seg a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; color: var(--mute); }
.d-seg a.on { border-color: var(--ac); color: var(--ac); background: var(--ac-soft); font-weight: 600; }
.d-big { font-family: var(--mono); font-size: 28px; font-weight: 500; line-height: 1.1; }

/* Control Tower */
.d-centers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.d-center { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius, 6px); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.d-center h3 { font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; }
.d-center h3 small { font-family: var(--mono); font-size: 10px; color: var(--mute); font-weight: 400; }
.d-center .m { display: grid; grid-template-columns: 70px 1fr 64px; gap: 8px; align-items: center; font-size: 11px; } .d-center .m > span:last-child { text-align: right; }
.d-center .m span:last-child { text-align: right; font-family: var(--mono); }
.d-feed li { display: grid; grid-template-columns: 52px 64px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 12px; list-style: none; }
.d-feed { margin: 0; padding: 0; } .d-feed li:last-child { border-bottom: 0; }
.d-feed .t { color: var(--mute); font-size: 11px; }
.d-ship { display: flex; align-items: center; gap: 16px; } .d-ship .ring { width: 92px; height: 92px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--ac) calc(var(--p) * 1%), var(--line-2) 0); position: relative; flex: none; }
.d-ship .ring::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--card); }
.d-ship .ring b { position: relative; z-index: 1; font-family: var(--mono); font-size: 18px; }

/* 입고 도크 — 안내판 + 타임라인 */
.d-board { background: #0d0f12; color: #f2e7c9; border-radius: var(--radius, 6px); padding: 10px 14px 14px; font-family: var(--mono); }
.d-board .hd, .d-board .rw { display: grid; grid-template-columns: 70px 1.6fr 1fr 64px 70px 64px 110px; gap: 10px; align-items: center; padding: 7px 4px; }
.d-board .hd { font-size: 10px; letter-spacing: .12em; color: #8b8e94; border-bottom: 1px solid #2a2d31; }
.d-board .rw { border-bottom: 1px dashed #24262a; font-size: 13px; } .d-board .rw:last-child { border-bottom: 0; }
.d-board .tm { font-size: 18px; color: #ffd166; }
.d-board .st { font-size: 11px; padding: 3px 8px; border-radius: 4px; text-align: center; background: #24262a; color: #e9eae6; letter-spacing: .05em; }
.d-board .st.done { background: #16301f; color: #6fd39a; } .d-board .st.late { background: #3d1f17; color: #ff7a59; }
.d-board .st.unloading, .d-board .st.checking, .d-board .st.arrived { background: #3a3016; color: #f0c452; }
.d-board .acts button { background: none; border: 1px solid #3a3d42; color: #e9eae6; border-radius: 4px; font-size: 11px; padding: 3px 7px; cursor: pointer; font-family: var(--font); }
.d-board .acts button:hover { border-color: #ffd166; color: #ffd166; }
.d-tl { position: relative; } .d-tl .hrs { display: grid; grid-template-columns: repeat(14, 1fr); margin-left: 44px; font-family: var(--mono); font-size: 10px; color: var(--mute); }
.d-tl .ln { display: grid; grid-template-columns: 44px 1fr; align-items: center; height: 30px; border-bottom: 1px solid var(--line-2); }
.d-tl .ln b { font-family: var(--mono); font-size: 11px; }
.d-tl .tr { position: relative; height: 22px; background: repeating-linear-gradient(90deg, transparent 0 calc(7.142% - 1px), var(--line-2) calc(7.142% - 1px) 7.142%); }
.d-tl .ev { position: absolute; top: 2px; height: 18px; border-radius: 3px; font-size: 10px; color: #fff; padding: 0 5px; white-space: nowrap; overflow: hidden; display: flex; align-items: center; }
.d-tl .ev.done { opacity: .45; } .d-tl .ev.late { outline: 2px solid var(--risk); }
.d-tl .now { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--risk); z-index: 2; pointer-events: none; }

/* 랙 맵 */
.d-floor { display: flex; flex-direction: column; gap: 14px; }
.d-zone { display: grid; grid-template-columns: 96px 1fr 48px; gap: 10px; align-items: center; }
.d-zone .zn b { display: block; font-size: 15px; font-family: var(--mono); } .d-zone .zn small { font-size: 11px; color: var(--mute); }
.d-aisles { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.d-aisle { display: grid; grid-template-rows: repeat(4, 16px); gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 4px; border-top: 3px solid var(--tz); }
.d-cell { border-radius: 2px; background: var(--line-2); display: block; }
.d-cell.l1 { background: color-mix(in srgb, var(--tz) 22%, transparent); } .d-cell.l2 { background: color-mix(in srgb, var(--tz) 48%, transparent); }
.d-cell.l3 { background: color-mix(in srgb, var(--tz) 78%, transparent); } .d-cell.l4 { background: var(--risk); }
.d-cell.sel { outline: 2px solid var(--ink); outline-offset: 1px; }
.d-aisle small { font-family: var(--mono); font-size: 9px; color: var(--mute); text-align: center; }
.d-leg { display: flex; gap: 12px; font-size: 11px; color: var(--mute); } .d-leg span { display: flex; gap: 5px; align-items: center; } .d-leg i { width: 12px; height: 12px; border-radius: 2px; }

/* 유통기한 라벨 */
.d-labels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.d-label { background: #fffdf6; color: #1b1b1b; border-radius: 6px; padding: 12px 14px 10px; border: 1px solid #d9d2c6; position: relative; display: flex; flex-direction: column; gap: 5px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04); border-left: 6px solid var(--lvc); }
.d-label .top { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 10px; color: #6b665d; }
.d-label b { font-size: 14px; line-height: 1.35; } .d-label .dd { font-family: var(--mono); font-size: 26px; font-weight: 600; color: var(--lvc); line-height: 1; }
.d-label .bc { height: 28px; background: repeating-linear-gradient(90deg, #1b1b1b 0 1px, transparent 1px 3px, #1b1b1b 3px 5px, transparent 5px 6px, #1b1b1b 6px 7px, transparent 7px 10px); opacity: .85; }
.d-label .meta { display: flex; justify-content: space-between; font-size: 11px; color: #4a453e; }
.d-label .lamp { display: flex; gap: 4px; } .d-label .lamp i { width: 10px; height: 10px; border-radius: 50%; background: #e3ddd2; }
.d-label .lamp i.on { background: var(--lvc); box-shadow: 0 0 6px var(--lvc); }
.d-label .act { font-size: 11px; color: var(--lvc); font-weight: 600; } .d-label input { position: absolute; right: 10px; bottom: 10px; accent-color: var(--lvc); }
.lv-ok { --lvc: #2e9d5b; } .lv-warn { --lvc: #c99a00; } .lv-risk { --lvc: #e8562a; } .lv-stop { --lvc: #6b6f76; }

/* 배송 노선도 */
.d-lines { display: flex; flex-direction: column; gap: 6px; }
.d-line { display: grid; grid-template-columns: 170px 1fr 120px; gap: 14px; align-items: center; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius, 6px); }
.d-line .car b { display: block; font-size: 13px; } .d-line .car small { font-size: 11px; color: var(--mute); }
.d-track { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 14px 6px 22px; }
.d-track::before { content: ""; position: absolute; left: 6px; right: 6px; top: 20px; height: 4px; border-radius: 2px; background: var(--line); }
.d-track .fill { position: absolute; left: 6px; top: 20px; height: 4px; border-radius: 2px; background: var(--lc); }
.d-st { position: relative; z-index: 1; width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 3px solid var(--line); }
.d-st.done { border-color: var(--lc); background: var(--lc); } .d-st.arrived { border-color: var(--lc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lc) 30%, transparent); }
.d-st.missed { border-color: var(--risk); }
.d-st span { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font-size: 9.5px; color: var(--mute); white-space: nowrap; max-width: 70px; overflow: hidden; text-overflow: ellipsis; }
.d-st.arrived span, .d-st.first span, .d-st.last span { color: var(--ink); font-weight: 600; }
.d-line .r { text-align: right; font-size: 11px; } .d-line .r b { font-family: var(--mono); font-size: 16px; display: block; }
.d-line.late { border-color: var(--risk); }

/* 장부 (거래처 원장) */
.d-book { background: #fbf8ef; color: #1f1d18; border: 1px solid #d9d0bd; border-radius: 6px; padding: 18px 22px; font-family: var(--font);
  background-image: repeating-linear-gradient(#fbf8ef 0 31px, #e8e0cc 31px 32px); }
.d-book table { width: 100%; border-collapse: collapse; font-size: 12px; } .d-book th { font-size: 11px; color: #6b6352; text-align: left; padding: 6px 6px; border-bottom: 2px solid #8b2a1e; font-weight: 500; }
.d-book td { height: 32px; padding: 0 6px; } .d-book td.n { text-align: right; font-family: var(--mono); }
.d-book tr.flag td { color: #a8402a; } .d-book .bal { font-weight: 600; }
.d-book .ttl { font-size: 18px; font-weight: 700; color: #8b2a1e; margin-bottom: 4px; display: flex; justify-content: space-between; align-items: baseline; }
.d-book .ttl small { font-size: 11px; color: #6b6352; font-weight: 400; }
.d-gauge { height: 10px; border-radius: 5px; background: var(--line-2); overflow: hidden; } .d-gauge i { display: block; height: 100%; }

/* 입점 박스 칸반 */
.d-kan { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.d-kcol { background: var(--th, var(--line-2)); border: 1px solid var(--line); border-radius: var(--radius, 6px); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 380px; }
.d-kcol .h { display: flex; justify-content: space-between; font-weight: 600; font-size: 12px; } .d-kcol .h small { font-family: var(--mono); color: var(--mute); font-weight: 400; }
.d-box { background: #e9d7b4; color: #2b2116; border-radius: 4px; padding: 10px; position: relative; display: flex; flex-direction: column; gap: 4px; font-size: 12px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08); }
.d-box::before { content: ""; position: absolute; left: calc(50% - 26px); width: 52px; top: -4px; height: 12px; background: rgba(255, 255, 255, .45); box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.d-box b { position: relative; font-size: 12.5px; } .d-box small { position: relative; font-size: 11px; color: #5b4a33; }
.d-box .stamp { position: absolute; right: 8px; top: 8px; border: 2px solid #b0302a; color: #b0302a; font-size: 10px; font-weight: 700; padding: 1px 5px; transform: rotate(-8deg); border-radius: 3px; }
.d-box button { position: relative; align-self: flex-start; background: none; border: 0; border-bottom: 1px solid #5b4a33; color: #5b4a33; font-size: 11px; cursor: pointer; padding: 0; }

/* 클레임 명세표 */
.d-slips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.d-slip { padding: 16px 18px; border: 1px solid #c9bfae; color: #1f1d18; font-size: 12px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.d-slip:nth-child(1) { background: #fffdf6; } .d-slip:nth-child(2) { background: #fdf3f3; } .d-slip:nth-child(3) { background: #f2f6fc; }
.d-slip h4 { font-size: 13px; letter-spacing: .3em; text-align: center; border-bottom: 2px double #1f1d18; padding-bottom: 6px; }
.d-slip dl { display: grid; grid-template-columns: 70px 1fr; gap: 4px 8px; margin: 0; } .d-slip dt { color: #6b6352; } .d-slip dd { margin: 0; }
.d-stamps { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.d-stamp { width: 66px; height: 66px; border-radius: 50%; border: 3px solid #c9bfae; color: #c9bfae; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; transform: rotate(-10deg); }
.d-stamp.on { border-color: #b0302a; color: #b0302a; }

/* 영업 동선 */
.d-visit { display: grid; grid-template-columns: 54px 22px 1fr 150px 120px; gap: 10px; align-items: center; padding: 10px 0; position: relative; }
.d-visit .dot { width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--ac); background: var(--card); position: relative; z-index: 1; }
.d-visit.done .dot { background: var(--ac); } .d-visit.missed .dot { border-color: var(--risk); }
.d-visit::before { content: ""; position: absolute; left: 71px; top: 0; bottom: 0; width: 3px; background: var(--line); }
.d-visit .tm { font-family: var(--mono); font-size: 14px; }

@media (max-width: 1100px) {
  .d-centers, .d-labels, .d-kan, .d-slips { grid-template-columns: 1fr; } .d-line { grid-template-columns: 1fr; }
  .d-board .hd, .d-board .rw { grid-template-columns: 60px 1fr 60px 90px; } .d-board .hd > :nth-child(n+5), .d-board .rw > :nth-child(5), .d-board .rw > :nth-child(6) { display: none; }
}
