.pa-main { gap: 12px; }
.pa-card { background:#fff; border:1px solid #dde1ea; border-radius:6px; overflow:auto; }
.pa-table { width:100%; border-collapse:collapse; min-width:1500px; }
.pa-table th { background:#eaecf2; padding:7px 8px; text-align:left; font-size:12px; position:sticky; top:0; }
.pa-table td { padding:7px 8px; border-bottom:1px solid #f0f0f0; vertical-align:top; }
.pa-table tr.row-boost td { background:#ecfdf3; }
.pa-table tr.row-watch td { background:#fff8df; }
.pa-table tr.row-risk td { background:#ffecec; }
.pa-table tr.row-manual td { background:#f5f6f8; }
.pa-rec { max-width:340px; font-weight:600; }
.pa-rec small { display:block; color:#666; font-weight:400; margin-top:4px; }
.pa-actions { display:flex; gap:6px; flex-wrap:wrap; }
.pa-export { align-items:center; flex-wrap:wrap; }
.pa-export a { text-decoration:none; display:inline-block; }
.pa-detail { padding:14px; display:grid; gap:14px; }
.pa-detail h2 { font-size:16px; }
.pa-history { display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
.pa-history table { width:100%; border-collapse:collapse; }
.pa-history th, .pa-history td { border-bottom:1px solid #eee; padding:6px; text-align:left; }
.pa-dialog { width:min(920px, 92vw); padding:20px; display:grid; gap:14px; }
.pa-grid-form { display:grid; grid-template-columns:repeat(4, minmax(140px, 1fr)); gap:10px; }
.pa-grid-form label, #resolve-fields label { display:flex; flex-direction:column; gap:4px; font-size:12px; color:#555; }
#resolve-fields { display:grid; gap:10px; }
.pa-pill { display:inline-block; padding:2px 7px; border-radius:12px; background:#edf2ff; color:#005bff; font-size:11px; }
@media (max-width: 900px) {
  .pa-history { grid-template-columns:1fr; }
  .pa-grid-form { grid-template-columns:1fr 1fr; }
}


.pa-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  border-bottom: 1px dotted #4b5563;
  cursor: help;
  outline: none;
}
.pa-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 500;
  white-space: normal;
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
}
.pa-tip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #111827;
  opacity: 0;
  pointer-events: none;
  z-index: 101;
}
.pa-tip:hover::after,
.pa-tip:hover::before,
.pa-tip:focus::after,
.pa-tip:focus::before {
  opacity: 1;
}


#pa-floating-tip {
  position: fixed;
  transform: translateX(-50%);
  min-width: 240px;
  max-width: 320px;
  padding: 9px 11px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
  opacity: 0;
  pointer-events: none;
  z-index: 99999;
  transition: opacity .08s ease;
}
#pa-floating-tip.is-visible { opacity: 1; }
.pa-tip::after, .pa-tip::before { display: none; }


.pa-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}
.pa-summary > div {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px 12px;
}
.pa-summary span { display:block; color:#6b7280; font-size:12px; margin-bottom:4px; }
.pa-summary strong { font-size:16px; }
.trend-good { color:#15803d; }
.trend-bad { color:#b91c1c; }
.trend-neutral { color:#4b5563; }
.pa-chart {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px;
}
.pa-chart svg { width:100%; height:240px; display:block; }
.pa-chart-legend { display:flex; gap:16px; font-weight:700; margin:0 0 6px 8px; }
.pa-history { grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); }
@media (max-width: 900px) { .pa-summary { grid-template-columns:1fr 1fr; } }


.pa-detail { position: relative; }
.pa-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.pa-close:hover { background: #f3f4f6; color: #111827; }


#product-panel.pa-card {
  position: fixed;
  left: 16px;
  right: 16px;
  top: 246px;
  bottom: 16px;
  z-index: 200;
  overflow: auto;
  box-shadow: 0 14px 40px rgba(15, 23, 42, .18);
}
#product-panel .pa-detail { min-height: 100%; }
.pa-close {
  font-family: Arial, sans-serif;
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
}

.pa-bot-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f8fafc;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}
.pa-bot-status.bot-partial { background:#fffbeb; border-color:#f59e0b; color:#92400e; }
.pa-bot-status.bot-failed { background:#fef2f2; border-color:#ef4444; color:#991b1b; }
.pa-bot-status.bot-ok { background:#f0fdf4; border-color:#22c55e; color:#166534; }
.pa-bot-hint {
  display: block;
  width: 100%;
  margin-top: 5px;
  color: #92400e;
  line-height: 1.35;
}

.pa-account-row { display: none; }
.pa-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}
.pa-check input { margin: 0; }
.pa-risk-cell {
  color: #dc2626;
  font-weight: 700;
}

.pa-rec-prices { margin:8px 0; display:grid; gap:3px; font-size:12px; font-weight:500; }
.pa-rec-prices div { display:grid; grid-template-columns:120px 1fr; gap:8px; align-items:center; }
.pa-rec-prices span { color:#555; }
.pa-rec-prices strong { font-size:15px; color:#111827; }
.pa-rec-prices .price-up { color:#b45309; }
.pa-rec-prices .price-down { color:#047857; }

.pa-confirm-text { margin:0; color:#374151; }
.pa-decision { display:inline-block; margin:8px 0 6px; padding:5px 8px; border-radius:6px; font-size:12px; font-weight:600; }
.pa-decision.is-applied { background:#dcfce7; color:#166534; }
.pa-decision.is-rejected { background:#f3f4f6; color:#374151; }
.btn-xs { padding:3px 7px; font-size:11px; }
.decision-flash-applied td { animation: decisionAppliedFlash 2s ease; }
.decision-flash-rejected td { animation: decisionRejectedFlash 2s ease; }
@keyframes decisionAppliedFlash {
  0%, 70% { background:#bbf7d0; }
  100% { background:inherit; }
}
@keyframes decisionRejectedFlash {
  0%, 70% { background:#e5e7eb; }
  100% { background:inherit; }
}
