/* 합사 온브릿 PM-1 — 19번 규격: 바탕 #F3F6FA · 표면 #FFF · 글 #183148 · 공정 #245CA6 · 검증 #16766F · 위험 #B74637 · 미확인 #6A7480 */
:root { --bg:#f3f6fa; --card:#fff; --ink:#183148; --blue:#245ca6; --green:#16766f; --red:#b74637; --muted:#6a7480; --line:#dbe3ec; --amber:#8b6419; --amber-bg:#fff5df; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 "Malgun Gothic", "맑은 고딕", system-ui, sans-serif; }
body { overflow-x: hidden; }
button, select, input, textarea { font: inherit; color: inherit; }
button { background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 6px 12px; cursor: pointer; min-height: 34px; }
button:hover { background: #edf3fa; }
button.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
button.primary:hover { background: #1d4c8b; }
button.danger { color: var(--red); }
:focus-visible { outline: 3px solid #d39528; outline-offset: 2px; }
input, select, textarea { border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; background: #fff; max-width: 100%; }
textarea { width: 100%; min-height: 60px; }
h1 { font-size: 24px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 0; } h3 { font-size: 14px; margin: 0 0 6px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .num { font-variant-numeric: tabular-nums; }
.bad { color: var(--red); } .ok { color: var(--green); } .warn { color: var(--amber); }

header.top { background: var(--ink); color: #fff; padding: 10px 24px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { font-size: 19px; font-weight: 800; } .brand small { font-size: 12px; font-weight: 400; margin-left: 10px; color: #bdcddd; }
nav { display: flex; gap: 6px; flex-wrap: wrap; }
nav button { background: transparent; color: #cbd9e6; border: 0; border-bottom: 2px solid transparent; border-radius: 0; }
nav button[aria-current="page"] { color: #fff; border-bottom-color: #6abdb8; }
nav button:hover { background: rgba(255,255,255,.08); }
.who { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: 12px; flex-wrap: wrap; }
.who button { background: transparent; color: #fff; border-color: #4a6680; min-height: 30px; padding: 3px 10px; }
.bell[data-n]:not([data-n="0"])::after { content: attr(data-n); background: var(--red); color: #fff; border-radius: 9px; padding: 0 6px; margin-left: 6px; font-size: 11px; }
.synthetic { background: #fff4d9; color: #74541d; padding: 6px 24px; font-size: 12px; }

main { max-width: 1600px; margin: 0 auto; padding: 18px 24px 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.card-h { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.card-b { padding: 12px 16px; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0 14px; }
.filters label { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.scope { margin-left: auto; font-size: 12px; color: var(--green); }

.summary { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; }
.stat { padding: 12px 16px; border-right: 1px solid var(--line); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

.layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); grid-template-areas: "main meet" "main side"; grid-template-rows: auto 1fr; gap: 16px; align-items: start; }
.area-main { grid-area: main; } .area-meet { grid-area: meet; } .area-side { grid-area: side; }
.side { display: grid; gap: 16px; }
.tabs { display: flex; gap: 4px; }
.tabs button { border: 0; color: var(--muted); }
.tabs button[aria-selected="true"] { background: #e7effa; color: var(--blue); font-weight: 700; }

.scroll { overflow-x: auto; max-width: 100%; }
.gantt { min-width: 640px; }
.g-axis, .g-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 110px; align-items: center; }
.g-axis { background: #f7f9fc; font-size: 12px; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.g-months { display: flex; } .g-months span { flex: 1; text-align: center; border-left: 1px solid #e7edf3; }
.g-row { padding: 8px 12px; border-bottom: 1px solid #edf1f5; cursor: pointer; min-height: 54px; background: #fff; border-left: 0; border-right: 0; border-top: 0; border-radius: 0; text-align: left; width: 100%; }
.g-row:hover, .g-row.sel { background: #f3f8fd; }
.g-row b { display: block; font-size: 13px; font-weight: 600; } .g-row small { color: var(--muted); font-size: 11px; }
.track { position: relative; height: 30px; }
.bar { position: absolute; height: 7px; border-radius: 2px; top: 11px; background: var(--blue); left: var(--l); width: var(--w); }
.bar.base { top: 3px; height: 4px; background: #c1cbd7; }
.bar.ms { width: 10px; height: 10px; transform: rotate(45deg); top: 10px; border-radius: 1px; }
.today-line { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--red); left: var(--l); }
.g-state { font-size: 11px; text-align: right; }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); padding: 8px 12px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 16px; height: 5px; margin-right: 5px; vertical-align: middle; background: var(--blue); }
.legend i.base { background: #c1cbd7; } .legend i.rep { background: var(--green); }

.prog { display: grid; gap: 2px; }
.p-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 230px; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid #edf1f5; background: #fff; border-left: 0; border-right: 0; border-top: 0; border-radius: 0; text-align: left; width: 100%; cursor: pointer; }
.p-row:hover { background: #f3f8fd; }
.p-name { font-weight: 600; font-size: 13px; }
.p-track { position: relative; height: 18px; background: repeating-linear-gradient(90deg, #f1f4f8 0, #f1f4f8 calc(10% - 1px), #e2e8ef calc(10% - 1px), #e2e8ef 10%); border-radius: 3px; }
.p-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: var(--green); border-radius: 3px; }
.p-none { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 8px; font-size: 12px; color: var(--muted); background: repeating-linear-gradient(45deg, #f6f7f9 0, #f6f7f9 6px, #eceff3 6px, #eceff3 12px); border-radius: 3px; }
.p-val { font-size: 12px; text-align: right; }
.p-val b { font-size: 15px; font-variant-numeric: tabular-nums; }
.spark { display: flex; gap: 2px; align-items: flex-end; height: 22px; margin-top: 2px; justify-content: flex-end; }
.spark i { display: block; width: 7px; background: #9ac4bf; height: var(--h); }
.spark i.none { background: #d9dee5; height: 3px; }
.spark i.cur { background: var(--green); }
.badge { font-size: 11px; padding: 1px 6px; border-radius: 3px; background: #eef1f5; color: var(--muted); white-space: nowrap; }
.badge.ok { background: #e6f3f1; color: var(--green); } .badge.warn { background: var(--amber-bg); color: var(--amber); } .badge.bad { background: #fff1ed; color: var(--red); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.item { display: block; width: 100%; text-align: left; border: 0; border-radius: 0; padding: 10px 14px; background: #fff; }
.item strong { display: block; font-size: 13px; } .item p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.meet-list { max-height: 300px; overflow-y: auto; }
.mstate { font-size: 11px; font-weight: 700; }
.mstate.now { color: var(--green); } .mstate.soon { color: var(--amber); } .mstate.done { color: var(--muted); } .mstate.cancel { color: var(--red); text-decoration: line-through; }
.np { padding: 14px 16px; color: var(--muted); font-size: 13px; background: #fafbfc; }

table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #e5eaf0; text-align: left; vertical-align: top; }
th { background: #f7f9fc; color: #5b6b7a; font-weight: 500; white-space: nowrap; }
.weekly td ul { margin: 0; padding-left: 16px; }
.mgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px; }
.mbox { border-left: 3px solid var(--blue); padding: 10px 12px; background: #f6f9fd; min-width: 0; }

.form { display: grid; gap: 12px; }
.frow { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.field { display: grid; gap: 4px; } .field > span { font-size: 12px; color: var(--muted); }
.items .irow { display: grid; grid-template-columns: minmax(0, 3fr) 1fr 1fr 1fr 1.2fr 1fr auto; gap: 6px; margin-bottom: 6px; }
.items .ihead { margin-bottom: 2px; }
@media (max-width: 700px) { .items .ihead { display: none; } }
.readonly { background: #f7f9fc; border: 1px dashed var(--line); border-radius: 6px; padding: 10px 12px; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .day { background: #fff; border: 1px solid var(--line); border-radius: 6px; min-height: 120px; padding: 6px; min-width: 0; }
.cal .day h4 { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.cal .day.today h4 { color: var(--blue); }
.ev { display: block; width: 100%; text-align: left; font-size: 12px; padding: 4px 6px; margin-bottom: 4px; border-left: 3px solid var(--blue); background: #f3f7fc; border-radius: 3px; border-top: 0; border-right: 0; border-bottom: 0; min-height: 0; overflow-wrap: anywhere; }
.ev.all { border-left-color: var(--green); } .ev.cancelled { opacity: .55; text-decoration: line-through; }
.ev[data-lane="1"] { margin-left: 8px; } .ev[data-lane="2"] { margin-left: 16px; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: #fff; border-left: 1px solid var(--line); box-shadow: -6px 0 24px rgba(24,49,72,.15); z-index: 20; display: flex; flex-direction: column; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); gap: 10px; }
#drawer-body { padding: 14px 16px; overflow-y: auto; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px; z-index: 30; max-width: 90vw; }
.login { max-width: 420px; margin: 40px auto; }
.below { margin-top: 16px; }
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #eef1f5; color: var(--muted); border: 0; min-height: 0; margin: 0 4px 4px 0; }
.chip.ok { background: #e6f3f1; color: var(--green); } .chip.bad { background: #fff1ed; color: var(--red); } .chip.blue { background: #e7effa; color: var(--blue); }
.badge.blue { background: #e7effa; color: var(--blue); }
form.card, .card + .card, .card + form.card { margin-top: 14px; }
.err { color: var(--red); font-size: 13px; }

/* PM-3 */
.pre { white-space: pre-wrap; margin: 0; }
.mgrid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
details.card > summary { cursor: pointer; font-weight: 700; list-style: revert; }
.tl { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--line); display: grid; gap: 8px; }
.tl li p { margin: 2px 0 0; }
.org-cos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 12px; }
.org-co { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; min-width: 0; }
.org-d + .org-d { margin-top: 8px; }
.person { padding: 6px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.person > div { flex-basis: 100%; }
table.preport-t { min-width: 900px; } table.preport-t td:first-child { white-space: nowrap; }
@media print { table.preport-t { min-width: 0; } }
.acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.small-btn { min-height: 26px; padding: 2px 8px; font-size: 12px; }
section.card + section.card { margin-top: 14px; }
@media print {
  header.top, .synthetic, .noprint, .drawer, .toast { display: none !important; }
  body, html { background: #fff; } main { padding: 0; max-width: none; }
  .card { break-inside: avoid; border-color: #999; }
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "meet" "main" "side"; grid-template-rows: auto; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(2) { border-right: 0; } .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 700px) {
  main { padding: 12px; } header.top { padding: 10px 12px; gap: 10px; }
  .summary { grid-template-columns: minmax(0, 1fr); } .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .p-row { grid-template-columns: 84px minmax(0, 1fr); } .p-val { grid-column: 1 / -1; text-align: left; }
  .mgrid, .mgrid.two { grid-template-columns: minmax(0, 1fr); }
  .cal { grid-template-columns: minmax(0, 1fr); } .cal .day { min-height: 0; }
  .items .irow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .scope { margin-left: 0; }
}
