/* 금성포장 업무시스템
   모양은 UI 설계 채팅의 목업(docs/19_UI_목업_진행현황.md, Main.dc.html)을 그대로 따른다.
   색·간격 값은 목업의 값을 옮긴 것. 바꿀 때는 목업과 함께 바꾼다. */
:root {
  --brand: #13D0CA;      /* CI Peacock Green: 선택 표시 줄 */
  --accent: #0B7F7C;     /* 버튼·링크 */
  --accent-dark: #086764;
  --accent-soft: #DDF3F2;
  --warn-soft: #FFF1DC; --warn-line: #E0A04A; --warn: #7A4300;
  --danger: #B42318; --danger-soft: #FEF3F2; --danger-line: #E3B4AE;
  --bg: #F3F6F7; --card: #FFFFFF; --head: #F5F7F8; --field: #F7F9FA;
  --line: #E1E6EA; --line-in: #EEF1F3; --line-strong: #D5DCE1; --line-btn: #C5CDD4;
  --text: #1F2A33; --text2: #35424D; --muted: #5A6672; --zero: #6B7782;
  --hover: #E8EEF0;
  --pad: 11px 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; font-size: 15px;
  color: var(--text); background: var(--bg); min-height: 100vh; }
a { color: var(--accent); } a:hover { color: var(--accent-dark); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
.num, .n { text-align: right; font-variant-numeric: tabular-nums; }
.c { text-align: center; }
.muted, .note { color: var(--muted); } .note { font-size: 13px; } .small { font-size: 13px; }

/* ---------- 머리줄 ---------- */
.top { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 10px 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand .mark { width: 40px; height: 40px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 20px; }
.bn { font-size: 22px; font-weight: 700; letter-spacing: .01em; }
.bd { width: 1px; height: 22px; background: var(--line-btn); }
.bt { font-size: 17px; font-weight: 500; }
.user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.av { width: 38px; height: 38px; border-radius: 50%; background: var(--muted); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.menu-toggle { display: none; border: 0; background: none; font-size: 24px; min-height: 44px; }

/* ---------- 왼쪽 메뉴 ---------- */
.body { display: flex; align-items: flex-start; }
.side { flex: 0 0 220px; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 61px;
  max-height: calc(100vh - 61px); overflow-y: auto; }
.side details > summary { list-style: none; display: flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px; font-weight: 700; color: var(--text); cursor: pointer; }
.side details > summary::-webkit-details-marker { display: none; }
.side details > summary:hover { background: var(--hover); }
.side details[open] > summary { color: var(--accent); }
.gt { font-size: 12px; color: var(--muted); padding: 10px 14px 4px; }
.mi { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 14px 0 22px; border-radius: 10px; color: var(--text2); text-decoration: none; }
a.mi:hover { background: var(--hover); color: var(--text2); }
a.mi.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
a.mi.soon { color: #7B8791; }
.cont { flex: 1; min-width: 0; padding: 16px 20px 32px 8px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- 열린 화면 탭 ---------- */
.tabs { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.tablist { display: flex; flex-wrap: wrap; gap: 6px; min-height: 42px; }
.stab { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; }
.stab.on { background: var(--accent); border-color: var(--accent); }
.stab .nm { display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px 0 16px; color: var(--text2); text-decoration: none; }
.stab.on .nm { color: #fff; font-weight: 700; }
.stab .x { width: 36px; min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 16px; }
.stab.on .x { color: #fff; }
.seg { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.seg button, .seg a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); background: #fff; color: var(--text2); text-decoration: none; }
.seg > :is(button, a):first-of-type { border-radius: 8px 0 0 8px; }
.seg > :is(button, a):last-of-type { border-radius: 0 8px 8px 0; margin-left: -9px; }
.seg .on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; position: relative; }

/* ---------- 카드 ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.chead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.chead h1 { font-size: 24px; } .chead h2 { font-size: 22px; }
.sub { color: var(--muted); font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.act { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-btn); border-radius: 10px; background: #fff; color: var(--text); font-weight: 500; white-space: nowrap; text-decoration: none; }
.act:hover { background: var(--bg); color: var(--text); }
.act.pri { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.act.pri:hover { background: var(--accent-dark); color: #fff; }
.act[disabled] { opacity: .45; cursor: not-allowed; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.filters label { display: flex; align-items: center; gap: 8px; color: var(--text2); }
.inp { min-height: 40px; font: inherit; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: var(--field); color: var(--text); }
.itabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.itab { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 500; text-decoration: none; }
.itab:hover { color: var(--accent); }
.itab.on { color: var(--accent); border-bottom-color: var(--brand); font-weight: 700; }

/* ---------- 왼쪽 목록 + 오른쪽 표 ---------- */
.split { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.lcol { flex: 1 1 190px; max-width: 260px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.lcol .scroll { max-height: 560px; overflow-y: auto; }
.lt { padding: 10px 14px; font-size: 13px; font-weight: 700; color: var(--text2); background: var(--head); border-bottom: 1px solid var(--line); }
.cust { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; border-bottom: 1px solid var(--line-in); background: #fff; color: var(--text); text-decoration: none; }
.cust:hover { background: var(--bg); color: var(--text); }
.cust.on { background: var(--accent-soft); font-weight: 700; box-shadow: inset 4px 0 0 var(--brand); }
.cnt { color: var(--muted); font-weight: 400; font-size: 13px; }
.rcol { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }

/* ---------- 표 ---------- */
.gbox { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.grid th { position: sticky; top: 0; z-index: 1; background: var(--head); border-bottom: 1px solid var(--line); font-weight: 700; font-size: 13px; color: var(--text2); text-align: left; padding: var(--pad); white-space: nowrap; }
.grid td { padding: var(--pad); border-bottom: 1px solid var(--line-in); white-space: nowrap; background: #fff; }
.grid td.wrap { white-space: normal; min-width: 240px; }
.grid tr.on td { background: var(--accent-soft); }
.grid tr.on td:first-child { box-shadow: inset 4px 0 0 var(--brand); }
.grid tr.click { cursor: pointer; } .grid tr.click:hover td { background: #F8FBFB; }
.grid .z { color: var(--zero); }
.grid .w { color: var(--danger); font-weight: 700; }
.grid .sub { display: block; font-size: 12px; margin: 0; }
body.dense .grid { font-size: 13px; } body.dense { --pad: 5px 8px; } body.dense .grid .sub { display: none; }
.keyb { color: var(--accent); font-weight: 700; text-decoration: underline; }
.stp { display: flex; gap: 4px; justify-content: center; }
.sp { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; border: 1px solid var(--line-btn); color: var(--muted); background: #fff; }
.sp.d { background: var(--accent); border-color: var(--accent); color: #fff; }
.sp.p { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.tot { display: flex; flex-wrap: wrap; gap: 6px 28px; padding: 12px 16px; background: var(--head); border-radius: 12px; font-size: 14px; }
.tot span { color: var(--muted); }
.pager { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }

/* ---------- 알약 ---------- */
.pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill.o { background: var(--warn-soft); color: var(--warn); }
.pill.g { background: #EEF1F3; color: var(--text2); }
.pill.r { background: var(--danger-soft); color: var(--danger); }
.pill.biz-GY { background: #E7EFF8; color: #24507F; }
.pill.biz-JJ { background: #F1E8F7; color: #6A3591; }

/* ---------- 상세 ---------- */
.flow { display: flex; flex-wrap: wrap; gap: 12px 34px; }
.st { position: relative; flex: 1 1 150px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 14px; background: #fff; }
.st:not(:last-child)::after { content: "›"; position: absolute; right: -24px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 22px; }
.st.d { background: var(--accent-soft); border-color: var(--accent); }
.st.p { background: var(--warn-soft); border-color: var(--warn-line); }
.sl { font-size: 13px; color: var(--text2); font-weight: 700; }
.sv { font-size: 14px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.jump { display: flex; flex-wrap: wrap; gap: 4px 18px; border-bottom: 1px solid var(--line); padding-bottom: 10px; font-size: 14px; }
.jump a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; text-decoration: none; }
.jump a:hover { text-decoration: underline; }
.sec { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; scroll-margin-top: 80px; }
.sec h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.pair { display: flex; flex-wrap: wrap; gap: 14px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; }
.fl { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.fv { min-height: 22px; padding: 8px 12px; border-radius: 8px; background: var(--bg); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.ph { flex-grow: 1; min-height: 200px; border: 1px dashed var(--line-btn); border-radius: 12px; background: var(--field); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px; text-align: center; }
.memo { min-height: 60px; border-radius: 8px; background: var(--bg); padding: 10px 12px; color: var(--muted); }
.empty { padding: 28px 16px; color: var(--muted); font-size: 14px; }
.warnbox { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 14px; font-size: 14px; }

/* ---------- 로그인 ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; }
.login .inp { width: 100%; }
.login .act { justify-content: center; width: 100%; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .side { position: fixed; left: 0; top: 61px; bottom: 0; z-index: 30; max-height: none; background: #fff; border-right: 1px solid var(--line);
    transform: translateX(-100%); transition: transform .15s; }
  body.nav-open .side { transform: none; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
  .cont { padding: 12px; }
  .top { padding: 8px 12px; }
  .bt, .user .nm, .seg > span { display: none; }
  .lcol { max-width: none; } .lcol .scroll { max-height: 220px; }
}
#detail { scroll-margin-top: 72px; }
.mini { min-height: 30px; padding: 0 10px; border: 1px solid var(--line-btn); border-radius: 8px; background: #fff; color: var(--text); font-size: 12px; }
.mini.dng { border-color: var(--danger-line); color: var(--danger); }
.act.dng { border-color: var(--danger-line); color: var(--danger); }
.act.dng:hover { background: var(--danger-soft); }
.side summary.mtab { font-size: 15px; }
.okbox { background: var(--accent-soft); color: var(--accent-dark); border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 700; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.mcard { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px 12px; color: var(--text); text-decoration: none; }
.mcard:hover { background: var(--bg); color: var(--text); }
.mcard.on { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 4px 0 0 var(--brand); }
.mth { display: flex; align-items: center; justify-content: center; height: 84px; border: 1px dashed var(--line-btn); border-radius: 8px; background: var(--field); color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.mno { font-weight: 700; font-size: 16px; }
.msub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.eline { display: flex; gap: 12px; align-items: flex-end; padding: 8px 0; border-bottom: 1px solid var(--line-in); font-size: 14px; flex-wrap: wrap; }
.fld { display: flex; flex-direction: column; }
.fld .inp { width: 100%; }
.sug { margin-top: 4px; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: #fff; }
.sg { display: flex; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-bottom: 1px solid var(--line-in); background: #fff; color: var(--text); text-align: left; align-items: center; }
.sg:hover { background: var(--accent-soft); }
.brand .logo { width: 30px; height: 30px; object-fit: contain; flex: 0 0 auto; }
.pm { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
[hidden] { display: none !important; }

/* 발주·입고·납품 */
.grid tr.ghead td { background: var(--bg); font-size: 13px; }
.pick { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-bottom: 1px solid var(--line-in); cursor: pointer; }
.pick:hover { background: var(--bg); }
.pick input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); }
.pick .pt { display: flex; flex-direction: column; gap: 2px; flex: 1; font-size: 14px; }
.pick .pt .muted { font-size: 12px; }
.pick.mine { box-shadow: inset 3px 0 0 var(--brand); }
.pick:has(input:checked) { background: var(--accent-soft); }
.pill.fx-ok { background: var(--accent-soft); color: var(--accent); }
.pill.fx-fail { background: #FDECEC; color: #B42318; }
.pill.fx-sent, .pill.fx-ready { background: #FFF6E0; color: #8A5A00; }
.faxf { display: flex; gap: 6px; align-items: center; }

/* 출하 계획 · 납품 캘린더 */
.board { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 6px; }
.bcol { flex: 0 0 290px; background: #F5F7F8; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.bhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 2px 4px; }
.bhead h3 { font-size: 16px; margin: 0; }
.scard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.msub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.pill.o { background: #FFF1DC; color: #7A4300; white-space: nowrap; }
.pill.g { background: #EEF1F3; color: #35424D; white-space: nowrap; }
.mv { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 2px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; min-width: 860px; }
.dow { font-size: 13px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px; }
.day { min-height: 118px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; color: var(--text); font-size: 12px; min-width: 0; text-decoration: none; }
.day:hover { background: var(--bg); color: var(--text); }
.day.out { background: #F7F9FA; color: var(--muted); }
.day.on { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--brand); }
.dn { font-weight: 700; font-size: 14px; }
.day.today .dn { color: var(--accent); text-decoration: underline; }
.ev { display: block; border-radius: 6px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; max-width: 100%; box-sizing: border-box; }
.filters .ev { display: inline-block; }
.ev.plan { background: #DDF3F2; color: #086764; }
.ev.due { background: #EEF1F3; color: #35424D; }
.ev.late { background: #FFF1DC; color: #7A4300; }
