.ent-page {
  padding: 20px 24px;
  max-width: 960px;
}

.ent-page-head {
  margin-bottom: 20px;
}

.ent-head {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 16px 0;
}

.ptv-load-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 24px;
}

.ptv-loading,
.ptv-empty {
  padding: 16px 0;
  color: rgba(0, 0, 0, 0.5);
  font-size: 14px;
}

.ptv-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;

  th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b6b85;
    background: #f5f5fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  td {
    padding: 10px 12px;
    font-size: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  tr:last-child td {
    border-bottom: none;
  }
}

// "Add Output" trigger button
.btn-primary.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: #7c3aed;
  border: none;
  border-radius: 20px;
  cursor: pointer;

  &:hover { background: #6d28d9; }
}

// "Delete" button
.btn-danger.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  color: #dc2626;
  background: transparent;
  border: 1px solid #f3c8c8;
  border-radius: 16px;
  cursor: pointer;

  &:hover { background: #fef2f2; border-color: #dc2626; }
}

// ---- Add Output panel with scroll container ----
.ptv-new-panel {
  border: 1px solid #e8e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 20px;
  max-width: 560px;
  max-height: 50vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;

  .ent-head {
    font-size: 16px;
    margin-bottom: 12px;
    flex-shrink: 0;
  }

  &::-webkit-scrollbar {
    width: 10px;
  }
  &::-webkit-scrollbar-thumb {
    background: #a78bfa;
    border-radius: 5px;
  }
  &::-webkit-scrollbar-track {
    background: #f3f4f6;
  }
  scrollbar-width: thin;
  scrollbar-color: #a78bfa #f3f4f6;
}

::ng-deep .ptv-new-panel {
  // Required for the outer panel's scroll to actually trigger —
  // without this the embedded form ignores max-height and just grows
  gb-metaform-embed {
    display: block !important;
    min-height: 0;
    flex-shrink: 1;
  }

  .section-grid {
    display: block !important;
    grid-template-columns: none !important;
    row-gap: 20px !important;
  }

  label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #4a4a68;
    margin-bottom: 4px;
  }

  input:not([type="checkbox"]),
  select {
    width: 100% !important;
    padding: 8px 10px;
    border: 1px solid #d8d8e4;
    border-radius: 6px;
    box-sizing: border-box;
    margin-bottom: 16px;
  }

  // Save/Cancel row
  .mfe-actions {
    flex-shrink: 0;
    display: flex !important;
    gap: 12px !important;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);

    button {
      padding: 12px 32px !important;
      min-width: 120px !important;
      height: 44px !important;
      font-size: 14px !important;
      border-radius: 8px !important;
      cursor: pointer !important;
    }

    button:first-of-type {
      background: #7c3aed !important;
      color: #fff !important;
      border: none !important;
      font-weight: 600 !important;
      &:hover { background: #6d28d9 !important; }
    }

    button:last-of-type {
      background: #f3f4f6 !important;
      color: #374151 !important;
      border: 1px solid #d1d5db !important;
      font-weight: 500 !important;
      &:hover { background: #e5e7eb !important; }
    }
  }
}