/* ============================================================
   Aidit PBC (Provided by Client) Management Styles
   Based on Aidit Pine/Paper Design System & Prototype v11
   ============================================================ */

/* ── Global Viewport Slide Pane ── */
/* 우측 고정 탭(PBC · Why?)이 본문을 덮지 않게 본문 오른쪽에 탭 폭만큼 자리를 비운다 (REQ-0092).
   탭은 화면 가장자리에 그대로 두고, 내용이 탭 밑으로 들어가지 않는다. */
body:has(.pbc-tab) main.flex-grow-1 {
  padding-right: var(--pbc-tab-gutter, 36px);
}

.pbc-tab {
  position: fixed;
  top: calc(50% - 50px);
  right: 0;
  transform: translateY(-50%);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 8px 0 0 8px;
  padding: 14px 7px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font: 600 12px "IBM Plex Sans", sans-serif;
  letter-spacing: .03em;
  transition: background 0.15s ease, transform 0.15s ease;
}

.pbc-tab:hover {
  background: var(--navy-light);
  transform: translateY(-50%) translateX(-2px);
}

.pbc-tab .badge-count {
  writing-mode: horizontal-tb;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--gold);
  color: #fff;
  border-radius: 10px;
  padding: 1px 6px;
}

.pbc-scrim {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 20, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 1050;
}

.pbc-scrim.open {
  opacity: 1;
  pointer-events: auto;
}

.pbc-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 480px;
  max-width: 95vw;
  background: var(--panel);
  border-left: 1px solid var(--gray-200);
  box-shadow: -8px 0 28px rgba(16, 24, 20, 0.18);
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1060;
  display: flex;
  flex-direction: column;
}

.pbc-panel.open {
  transform: translateX(0);
}

.pbc-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--panel-2);
  flex-wrap: wrap;
}

.pbc-panel-head .title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 600;
  color: var(--pine-deep);
  margin-right: 4px;
}

.pbc-panel-head .badge-pill {
  font-size: 11px;
  font-weight: 600;
  border-radius: 99px;
  padding: 2px 8px;
}

.badge-waiting {
  background: var(--gold-pale);
  color: var(--gold);
  border: 1px solid var(--gold-line);
}

.badge-overdue {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid #f2a690;
}

.badge-toreview {
  background: var(--violet-bg);
  color: var(--violet);
  border: 1px solid #c7b3e5;
}

.badge-received {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid #a8d5be;
}

.badge-notsent {
  background: var(--gray-100);
  color: var(--gray-500);
  border: 1px solid var(--gray-300);
}

.pbc-panel-ctx {
  padding: 7px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--navy);
  background: #eaf1ee;
  border-bottom: 1px solid var(--gray-200);
}

.pbc-panel-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pbc-panel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-200);
  font-size: 12.5px;
}

.pbc-panel-row .info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pbc-panel-row .name {
  font-weight: 500;
  color: var(--gray-900);
  font-size: 12.5px;
  white-space: normal;
}

.pbc-panel-row .meta {
  color: var(--gray-500);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.pbc-panel-more {
  padding: 10px 0 4px;
  font-size: 12px;
  color: var(--navy-light);
  border-top: 1px dashed var(--gray-300);
  margin-top: 8px;
  cursor: pointer;
  font-weight: 600;
}

.pbc-panel-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200);
  background: var(--panel-2);
}

/* ── Bank Browser 3-Choice Interaction ── */
.pbc-fx {
  display: inline-flex;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  overflow: hidden;
  font-size: 11px;
  white-space: nowrap;
}

.pbc-fx span {
  padding: 4px 10px;
  cursor: pointer;
  color: var(--gray-500);
  background: var(--panel);
  border-right: 1px solid var(--gray-200);
  user-select: none;
  transition: all 0.15s ease;
}

.pbc-fx span:last-child {
  border-right: 0;
}

.pbc-fx span.on {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
}

.pbc-fx span.on.alt {
  background: var(--panel-3);
  color: var(--gray-900);
  font-weight: 600;
}

.bank-row.req td {
  background: #f4f8f6;
}

.bank-row.alt td {
  color: var(--gray-500);
}

.bank-row.alt .itemname {
  text-decoration: line-through;
  text-decoration-color: var(--gray-400);
  color: var(--gray-400);
}

.pbc-src-pill {
  display: inline-block;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  padding: 3px 8px;
  background: var(--panel);
  font-size: 11.5px;
  cursor: pointer;
  margin-right: 6px;
  margin-bottom: 4px;
  transition: all 0.15s ease;
}

.pbc-src-pill.on {
  border-color: var(--navy);
  color: var(--navy);
  background: #eaf1ee;
  font-weight: 600;
}

/* ── PBC Request List Page ── */
.pbc-page-container {
  padding: 20px 28px;
  max-width: 1400px;
  margin: 0 auto;
}

.pbc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 14px;
}

.pbc-header h1 {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 600;
  color: var(--pine-deep);
  margin-bottom: 4px;
}

.pbc-banner-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gold-pale);
  border: 1px solid var(--gold-line);
  border-radius: 6px;
  padding: 10px 16px;
  margin-bottom: 18px;
}

.pbc-banner-cta .text {
  font-size: 13px;
  font-weight: 500;
  color: var(--gold);
}

.pbc-kpi-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.pbc-kpi-card {
  flex: 1;
  min-width: 130px;
  background: var(--panel);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 10px 14px;
}

.pbc-kpi-card .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pbc-kpi-card .val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--pine-deep);
}

.pbc-group-header {
  background: var(--panel-2);
  border: 1px solid var(--gray-200);
  border-radius: 6px 6px 0 0;
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pine-deep);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

/* REQ-0130: 묶음(부모) 머리글 — 이름 + 수령 집계만, 상태 없음 */
.pbc-bundle-header td {
    background: #f3f6fb;
    border-top: 1px solid #d6dee8;
}
.pbc-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--gray-200);
  border-top: 0;
  font-size: 12.5px;
  margin-bottom: 16px;
}

.pbc-table th {
  background: var(--panel-3);
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
}

.pbc-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}

.pbc-table tr:hover td {
  background: #fbf9f4;
}

/* ── Validation Modal (SC-04) ── */
.pbc-val-decision-box {
  background: var(--panel);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}

.pbc-val-ai-box {
  background: var(--panel-2);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 14px;
  margin-top: 12px;
}

.pbc-val-ai-box .header {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--violet);
  margin-bottom: 6px;
}

.synthetic-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.02em;
}

/* ── Guidance Pane Styles (JJ-P01 v1.1) ── */
.guidance-tab {
  position: fixed;
  top: calc(50% + 45px);
  right: 0;
  transform: translateY(-50%);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: #0f766e;
  color: #fff;
  border: 0;
  border-radius: 8px 0 0 8px;
  padding: 14px 7px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font: 600 12px "IBM Plex Sans", sans-serif;
  letter-spacing: .03em;
  transition: background 0.15s ease, transform 0.15s ease;
}

.guidance-tab:hover {
  background: #115e59;
  transform: translateY(-50%) translateX(-2px);
}

.chain-node-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  position: relative;
}

.chain-node-box.focus-node {
  border: 2px solid #0f766e;
  background: #f0fdfa;
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.1);
}

.chain-arrow {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  margin-top: -4px;
  margin-bottom: 4px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  color: #334155;
  margin-bottom: 6px;
}

.sentence-tag {
  font-weight: 700;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 4px;
}

.sentence-tag-rule {
  background: #e2e8f0;
  color: #334155;
}

.sentence-tag-evidence {
  background: #dbeafe;
  color: #1e40af;
}

.sentence-tag-standard {
  background: #fef3c7;
  color: #92400e;
}

.chat-bubble-ai {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px 8px 8px 2px;
  padding: 10px 12px;
  font-size: 12.5px;
  margin-bottom: 10px;
}

.chat-bubble-user {
  background: #0f766e;
  color: #ffffff;
  border-radius: 8px 8px 2px 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  margin-bottom: 10px;
  margin-left: auto;
  max-width: 85%;
}

.chat-sources-box {
  background: #f1f5f9;
  border-top: 1px dashed #cbd5e1;
  padding: 6px 10px;
  margin-top: 8px;
  border-radius: 4px;
  font-size: 11.5px;
  color: #475569;
}

