/**
 * 발주관리 — 모듈 전용.
 */

.c-drawer.c-drawer--wide {
    width: min(1000px, 96vw);
}
.c-drawer.c-drawer--wide[aria-hidden="false"] { right: 0; }
.c-drawer.c-drawer--wide[aria-hidden="true"]  { right: calc(-1 * min(1000px, 96vw)); }

.po-line-add {
    padding: 12px 14px;
    background: rgb(255 255 255 / 0.012);
    border: 1px solid rgb(255 255 255 / 0.04);
    border-radius: 10px;
}

#linesTable.table-compact th,
#linesTable.table-compact td {
    padding: 6px 8px;
    font-size: 12px;
}
#linesTable thead th { background: transparent; }
#linesTable tbody td { border-bottom: 1px solid rgb(255 255 255 / 0.04); }

/* 셀 세로 구분선 */
#tbl thead th,
#tbl tbody td {
    border-right: 1px solid rgb(255 255 255 / 0.07);
}
#tbl thead th:last-child,
#tbl tbody td:last-child {
    border-right: 0;
}
#tbl tbody tr {
    cursor: pointer;
    transition: background var(--t-fast) var(--ease);
}
#tbl tbody tr:hover td { background: rgb(255 255 255 / 0.025); }
#tbl tbody tr.row-canceled { opacity: 0.55; }

/* 입고율 progress bar */
.recv-bar {
    width: 80px;
    height: 6px;
    background: rgb(255 255 255 / 0.06);
    border-radius: 999px;
    overflow: hidden;
    margin: 0 auto 2px;
}
.recv-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--brand-light));
    transition: width var(--t-base) var(--ease);
}
.recv-bar__fill[data-rate="100"] {
    background: linear-gradient(90deg, #69d685, #4ec06d);
}
.recv-bar__fill[data-rate="0"] {
    background: rgb(255 255 255 / 0.10);
}

.line-remove {
    background: transparent; border: 0;
    color: var(--ink-500); cursor: pointer;
    padding: 4px; border-radius: 4px;
}
.line-remove:hover { color: var(--bad-300); background: rgb(255 95 103 / 0.08); }

#mineToggle[aria-pressed="true"] {
    background: linear-gradient(180deg, rgb(139 149 255 / 0.16), rgb(139 149 255 / 0.06));
    border-color: var(--border-brand);
    color: var(--brand-light);
}

/* PR 라인 칩 */
.chip-prq {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    background: rgb(91 154 255 / 0.12);
    color: rgb(140 184 255);
    border: 1px solid rgb(91 154 255 / 0.20);
}

/* 모달 */
.c-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgb(11 14 22 / 0.55);
    backdrop-filter: blur(4px);
    z-index: 90;
}
.c-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 91;
    width: min(560px, 92vw);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: var(--surface-2, #15192a);
    border: 1px solid var(--border, rgb(255 255 255 / 0.08));
    border-radius: 14px;
    box-shadow: 0 30px 80px rgb(0 0 0 / 0.5);
    overflow: hidden;
}
.c-modal--wide { width: min(900px, 95vw); }
.c-modal__head {
    display: flex; align-items: center;
    padding: 14px 18px;
    font-size: 14px; font-weight: 600;
    color: var(--ink-100);
    border-bottom: 1px solid rgb(255 255 255 / 0.06);
}
.c-modal__close {
    margin-left: auto;
    background: transparent;
    border: 0;
    color: var(--ink-400);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all var(--t-fast) var(--ease);
}
.c-modal__close:hover { background: rgb(255 255 255 / 0.05); color: var(--ink-100); }
.c-modal__body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.c-modal__foot {
    padding: 12px 18px;
    border-top: 1px solid rgb(255 255 255 / 0.06);
    display: flex; gap: 8px; justify-content: flex-end;
    background: rgb(255 255 255 / 0.012);
}

#prImportTable.table-compact th,
#prImportTable.table-compact td {
    padding: 6px 8px;
    font-size: 12px;
}
#prImportTable tbody tr.is-disabled td {
    opacity: 0.5;
}

/* ─────────────────────────────────────────────────────────────
   반제품 발주생성 모달
   ───────────────────────────────────────────────────────────── */
#bomGenModal .c-modal__body { max-height: 72vh; }

.bomgen__step { padding: 2px 2px 14px; }
.bomgen__step + .bomgen__step {
    border-top: 1px solid rgb(255 255 255 / 0.06);
    padding-top: 16px;
    margin-top: 4px;
}
.bomgen__step-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600;
    color: var(--ink-100);
    margin-bottom: 12px;
}
.bomgen__step-no {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--brand); color: #fff;
    font-size: 11px; font-weight: 700; flex: 0 0 auto;
}

.bomgen__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.bomgen__chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 8px 4px 10px; border-radius: 999px;
    background: rgb(255 255 255 / 0.06);
    border: 1px solid rgb(255 255 255 / 0.08);
    font-size: 12px; color: var(--ink-100);
}
.bomgen__chip b { color: var(--brand-light); font-weight: 700; }
.bomgen__chip button {
    border: 0; background: none; color: var(--ink-400);
    cursor: pointer; padding: 0 2px; line-height: 1;
}
.bomgen__chip button:hover { color: var(--bad-300); }

.bomgen__opts {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin: 10px 0 14px;
}
.bomgen__check {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; cursor: pointer; user-select: none;
    color: var(--ink-100);
}
.bomgen__check input { width: 15px; height: 15px; accent-color: var(--brand); }
.bomgen__dates { display: flex; gap: 10px; }
.bomgen__dates .form-input { width: 140px; }

/* 미리보기 — 거래처 그룹 카드 */
.bomgrp {
    border: 1px solid rgb(255 255 255 / 0.08);
    border-radius: 10px; margin-bottom: 12px; overflow: hidden;
}
.bomgrp--unassigned { border-color: rgb(245 158 11 / 0.40); }
.bomgrp__head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 8px 12px;
    background: rgb(255 255 255 / 0.03); font-size: 13px;
}
.bomgrp--unassigned .bomgrp__head { background: rgb(245 158 11 / 0.08); }
.bomgrp__name { font-weight: 600; color: var(--ink-50, #f3f4f6); }
.bomgrp__meta { font-size: 11px; color: var(--ink-400); white-space: nowrap; }
.bomgrp__meta b { color: var(--brand-light); }

.bomgrp table { width: 100%; border-collapse: collapse; }
.bomgrp th, .bomgrp td {
    padding: 5px 10px; font-size: 12px;
    border-top: 1px solid rgb(255 255 255 / 0.05);
    text-align: right; white-space: nowrap;
}
.bomgrp th { color: var(--ink-500); font-weight: 500; background: transparent; }
.bomgrp th:first-child, .bomgrp td:first-child {
    text-align: left; white-space: normal;
    color: var(--ink-100); width: 100%;
}
.bomgrp input.bomprice {
    width: 92px; text-align: right;
    padding: 3px 6px; font-size: 12px;
}
.bomgrp .bom-uchk { width: 14px; height: 14px; accent-color: var(--brand); vertical-align: -2px; }

/* 미지정 → 거래처 이동 바 */
.bomgen__assign {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 10px 12px; margin-top: 4px;
    border: 1px dashed rgb(245 158 11 / 0.35);
    border-radius: 10px; background: rgb(245 158 11 / 0.04);
}
.bomgen__assign-ta { flex: 1; min-width: 180px; }

.bomgen__skip {
    font-size: 12px; color: #fbbf24;
    margin: 4px 0 10px; line-height: 1.5;
}
.bomgen__skip i { margin-right: 4px; }
