/* Figma 11:2408 / 42:2 Portfolio Overview */

.po-summary {
  margin-bottom: 0;
}

.po-split {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}

.po-big {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
}

.po-table-labels {
  max-width: 28rem;
}

.po-empty-row td {
  padding: 26px 16px !important;
  color: var(--text-muted);
  text-align: center;
}

.po-row-remove {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 32px;
  border: 1px solid rgba(255, 113, 108, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(255, 113, 108, 0.04);
  color: rgba(255, 168, 163, 0.86);
  font: 600 12px var(--font-sans);
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.po-row-remove:hover {
  border-color: rgba(255, 113, 108, 0.56);
  background: rgba(255, 113, 108, 0.1);
  color: var(--accent-red);
}

.po-row-remove:focus-visible {
  outline: 2px solid rgba(255, 113, 108, 0.38);
  outline-offset: 2px;
}

.chip--danger {
  color: var(--accent-red);
  border: 1px solid rgba(255, 113, 108, 0.25);
  background: rgba(255, 113, 108, 0.06);
}

#btn-run-ai[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.po-ai {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}

body.po-modal-open {
  overflow: hidden;
}

.po-modal[hidden] {
  display: none;
}

.po-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.po-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 16, 0.76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.po-modal__panel {
  position: relative;
  width: min(420px, 100%);
  border: 1px solid var(--border-glow);
  border-radius: 18px;
  background: rgba(21, 26, 33, 0.96);
  color: var(--text-primary);
  padding: 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.po-modal__cancel {
  position: absolute;
  top: 18px;
  right: 18px;
  border: 1px solid rgba(255, 113, 108, 0.42);
  border-radius: 999px;
  background: rgba(255, 113, 108, 0.08);
  color: var(--accent-red);
  font: 600 12px var(--font-sans);
  padding: 6px 10px;
  cursor: pointer;
}

.po-modal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.1;
}

.po-modal__subtitle {
  margin: 8px 0 22px;
  color: var(--text-muted);
  font-size: 13px;
}

.po-modal__status {
  margin: -8px 0 16px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 255, 163, 0.18);
  border-radius: 10px;
  background: rgba(0, 255, 163, 0.08);
  color: var(--accent-green);
  font-size: 12px;
}

.po-modal__status--error {
  border-color: rgba(255, 113, 108, 0.24);
  background: rgba(255, 113, 108, 0.08);
  color: var(--accent-red);
}

.po-modal__form {
  display: grid;
  gap: 14px;
}

.po-modal__field {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 14px;
}

.po-modal__field span {
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 13px;
}

.po-modal__field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: 500 14px var(--font-sans);
}

.po-modal__field input::placeholder {
  color: rgba(168, 171, 179, 0.72);
}

.po-modal__field--search {
  position: relative;
}

.po-fund-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 264px;
  overflow-y: auto;
  border: 1px solid var(--border-glow);
  border-radius: 12px;
  background: rgba(15, 19, 25, 0.98);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.po-fund-results[hidden] {
  display: none;
}

.po-fund-result {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
  font: 500 13px var(--font-sans);
  text-align: left;
  padding: 10px 14px;
  cursor: pointer;
}

.po-fund-result:last-child {
  border-bottom: 0;
}

.po-fund-result:hover {
  background: rgba(129, 236, 255, 0.08);
}

.po-fund-result code {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 12px;
}

.po-fund-result span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.po-fund-result small {
  color: var(--text-muted);
  font-size: 11px;
}

.po-fund-results__empty {
  padding: 14px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.po-fund-selected {
  margin: -6px 0 0;
  color: var(--accent-green);
  font-size: 12px;
}

.po-fund-selected code {
  font-family: var(--font-mono);
}

.po-modal__actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 6px;
}

.po-modal__confirm {
  border: 1px solid rgba(0, 255, 163, 0.5);
  border-radius: 999px;
  background: rgba(0, 255, 163, 0.12);
  color: var(--accent-green);
  font: 700 13px var(--font-sans);
  letter-spacing: 0.02em;
  padding: 10px 18px;
  cursor: pointer;
}

.po-modal__confirm:hover,
.po-modal__cancel:hover {
  filter: brightness(1.12);
}

@media (max-width: 560px) {
  .po-modal {
    align-items: end;
    padding: 12px;
  }

  .po-modal__panel {
    border-radius: 18px 18px 14px 14px;
    padding: 24px 18px;
  }

  .po-modal__field {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
