/* PID Library & Modification Tracker (tool 34) */
.pid-lib { display: flex; flex-direction: column; gap: 0.85rem; }
.pid-lib-head h4 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 700; color: #0f172a; }
.pid-lib-hint { margin: 0; color: #64748b; font-size: 0.9rem; }
.pid-lib-site { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 0.55rem 0.8rem; }
.pid-lib-site-label { font-weight: 600; color: #334155; }
.pid-lib-site-value { font-weight: 700; color: #0f172a; }
.pid-lib-site-unmapped { color: #9a3412; background: #fff7ed; border-radius: 6px; padding: 0.1rem 0.4rem; }
.pid-lib-site-union, .pid-lib-site-mapped { color: #1e4d6b; background: #e8f1f6; border-radius: 6px; padding: 0.1rem 0.45rem; font-weight: 600; }
.pid-lib-tabs { display: flex; gap: 0.35rem; }
.pid-lib-tab { border: 1px solid #cbd5e1; background: #fff; border-radius: 999px; padding: 0.3rem 0.85rem;
  font: inherit; font-weight: 600; cursor: pointer; color: #334155; }
.pid-lib-tab.is-active { background: #1e4d6b; color: #fff; border-color: #1e4d6b; }
.pid-lib-table { width: 100%; border-collapse: collapse; }
.pid-lib-table th, .pid-lib-table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid #e2e8f0;
  vertical-align: top; }
.pid-lib-table th { font-size: 0.8rem; color: #64748b; font-weight: 600; }
.pid-lib-flag { display: inline-block; margin-left: 0.4rem; font-size: 0.75rem; font-weight: 700;
  color: #9a3412; background: #ffedd5; border-radius: 999px; padding: 0.1rem 0.45rem; }
.pid-lib-empty { color: #64748b; padding: 0.6rem 0; }
.pid-lib-rev { display: flex; flex-direction: column; gap: 0.6rem; }
.pid-lib-rev-card { border: 1px solid #e2e8f0; border-radius: 10px; padding: 0.7rem 0.85rem; background: #fff; }
.pid-lib-rev-head { display: flex; justify-content: space-between; gap: 1rem; font-weight: 600; }
.pid-lib-rev-meta { color: #64748b; font-size: 0.85rem; margin-top: 0.2rem; }
.pid-lib-sdex-thread { margin: 0.4rem 0 0; padding: 0.4rem 0.6rem; background: #f8fafc; border-radius: 8px; font-size: 0.85rem; }
.pid-lib-sdex-thread li { margin: 0.15rem 0; }
.pid-lib-comments { margin-top: 0.4rem; }
.pid-lib-comments ul { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.pid-lib-comments li { padding: 0.35rem 0; border-bottom: 1px solid #e2e8f0; }
.pid-lib-comments .pid-lib-when { color: #64748b; font-size: 0.8rem; }
.pid-lib-add { display: flex; flex-direction: column; gap: 0.4rem; }
.pid-lib-add textarea { width: 100%; min-height: 64px; border: 1px solid #cbd5e1; border-radius: 8px;
  padding: 0.45rem 0.55rem; font: inherit; }
#tool-drawer.pid-only .form-group[data-field="project_name"],
#tool-drawer.pid-only .form-group[data-field="project_code"],
#tool-drawer.pid-only .form-group[data-field="site"],
#tool-drawer.pid-only .form-group[data-field="pid_status"],
#tool-drawer.pid-only .form-group[data-field="layout_status"],
#tool-drawer.pid-only .form-group[data-field="conflicts"],
#tool-drawer.pid-only .form-group[data-field="resolution_actions"] { display: none !important; }

.pidc-row-retained { border-color: #fdba74; background: #fff7ed; }
.pidc-flag { font-size: 0.75rem; font-weight: 700; color: #9a3412; margin-left: 0.35rem; }

/* Compact B/C list + detail card + PDF slot */
.pid-lib-toolbar { display: flex; flex-wrap: wrap; gap: 0.55rem 0.85rem; align-items: center; }
.pid-lib-search input, .pid-lib-filter select {
  border: 1px solid #cbd5e1; border-radius: 8px; padding: 0.35rem 0.55rem; font: inherit;
}
.pid-lib-search { flex: 1 1 16rem; }
.pid-lib-search input { width: 100%; }
.pid-lib-filter { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: #475569; }
.pid-lang { display: inline-flex; border: 1px solid #cbd5e1; border-radius: 999px; overflow: hidden; }
.pid-lang-btn { border: 0; background: #fff; padding: 0.25rem 0.7rem; font: inherit; font-weight: 700;
  cursor: pointer; color: #334155; }
.pid-lang-btn.is-active { background: #1e4d6b; color: #fff; }
.pid-pdf-icon { display: inline-flex; align-items: center; color: #b91c1c; }
.pid-pdf-icon.is-missing { width: 14px; height: 14px; }
.pid-pdf-cell { width: 1.6rem; text-align: center; }
.pid-row .pid-drawing { font-weight: 650; }
.pid-lib-body.has-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem); gap: 1rem; align-items: start; }
@media (max-width: 900px) {
  .pid-lib-body.has-detail { grid-template-columns: 1fr; }
}
.pid-detail-card { border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 0.9rem 1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06); position: sticky; top: 0.75rem; }
.pid-detail-head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.pid-detail-head h3 { margin: 0; font-size: 1.15rem; }
.pid-detail-kicker { margin: 0 0 0.15rem; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: #64748b; font-weight: 700; }
.pid-detail-desc h4, .pid-detail-pdf h4, .pid-detail-fields + * { margin: 0.85rem 0 0.35rem; font-size: 0.85rem; }
.pid-detail-fields { display: grid; gap: 0.45rem 0.8rem; margin: 0.6rem 0 0; }
.pid-detail-field { display: grid; gap: 0.1rem; }
.pid-detail-field dt { font-size: 0.75rem; color: #64748b; font-weight: 650; }
.pid-detail-field dd { margin: 0; }
.pid-mt-flag { display: inline-block; margin-left: 0.4rem; font-size: 0.7rem; font-weight: 700;
  color: #1e4d6b; background: #e8f1f6; border-radius: 999px; padding: 0.05rem 0.45rem; }
.pid-mt-flag.is-human { color: #166534; background: #dcfce7; }
.pid-show-orig { margin-left: 0.45rem; border: 0; background: none; color: #1e4d6b; font: inherit;
  font-size: 0.8rem; font-weight: 650; cursor: pointer; text-decoration: underline; }
.pid-orig { margin-top: 0.25rem; font-size: 0.9rem; color: #334155; background: #f8fafc; border-radius: 6px; padding: 0.25rem 0.45rem; }
.pid-orig-label { font-weight: 700; color: #64748b; margin-right: 0.3rem; }
.pid-en-edit { margin-top: 0.4rem; display: flex; flex-direction: column; gap: 0.3rem; }
.pid-en-edit textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 0.35rem 0.5rem; font: inherit; }
.pid-pdf-slot { border: 1px dashed #cbd5e1; border-radius: 10px; padding: 0.65rem 0.75rem; background: #f8fafc; }
.pid-pdf-slot.has-file { border-style: solid; background: #fff; }
.pid-pdf-meta { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; }
.pid-pdf-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.45rem 0; }
.pid-pdf-frame { width: 100%; height: 280px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }
