@saasicat/ui-vue 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +47 -0
  3. package/dist/index.cjs +3776 -0
  4. package/dist/index.d.cts +2395 -0
  5. package/dist/index.d.ts +2395 -0
  6. package/dist/index.js +3659 -0
  7. package/dist/testing-e2e/admin-pages-suite.cjs +134 -0
  8. package/dist/testing-e2e/admin-pages-suite.d.cts +37 -0
  9. package/dist/testing-e2e/admin-pages-suite.d.ts +37 -0
  10. package/dist/testing-e2e/admin-pages-suite.js +109 -0
  11. package/package.json +87 -0
  12. package/src/action-registry.ts +110 -0
  13. package/src/batch-column-fetcher.ts +152 -0
  14. package/src/boot-loader.ts +60 -0
  15. package/src/components/BundleVersionPublishDialog.vue +359 -0
  16. package/src/components/BusinessTypeVersionEditorDialog.vue +417 -0
  17. package/src/components/BusinessTypeVersionPublishDialog.vue +258 -0
  18. package/src/components/FeatureGate.vue +56 -0
  19. package/src/components/KpiCard.vue +53 -0
  20. package/src/components/KvBlock.vue +36 -0
  21. package/src/components/MarketingPromotionsTab.vue +861 -0
  22. package/src/components/MfaPromptDialog.vue +104 -0
  23. package/src/components/TenantActionConfirmDialog.vue +252 -0
  24. package/src/components/VersionDiffPreview.vue +150 -0
  25. package/src/components/bundle-editor/BundleCreatePanel.vue +681 -0
  26. package/src/components/bundle-editor/BundleFeaturesEditor.vue +215 -0
  27. package/src/components/bundle-editor/BundlePlanCompatPicker.vue +316 -0
  28. package/src/components/bundle-editor/BundleQuotasEditor.vue +219 -0
  29. package/src/components/bundle-editor/BundleStatusBanner.vue +189 -0
  30. package/src/components/bundle-editor/BundleVersionInlineEditor.vue +659 -0
  31. package/src/components/bundle-editor/BundleVersionStrip.vue +207 -0
  32. package/src/components/bundle-editor/bundle-version-status.ts +164 -0
  33. package/src/components/bundle-editor/catalog-i18n.ts +85 -0
  34. package/src/components/dialogs/PilotCreateDialog.vue +780 -0
  35. package/src/components/dialogs/PilotEditDialog.vue +548 -0
  36. package/src/components/dialogs/PromoCodeCreateDialog.vue +737 -0
  37. package/src/components/dialogs/PromoCodeEditDialog.vue +859 -0
  38. package/src/components/dialogs/types.ts +126 -0
  39. package/src/components/plan/PlanCycleToggle.vue +99 -0
  40. package/src/components/plan/PlanGrid.vue +211 -0
  41. package/src/components/plan/PriceSummary.vue +293 -0
  42. package/src/components/plan/PromoCodeInput.vue +192 -0
  43. package/src/components/plan/PublicBundleGrid.vue +287 -0
  44. package/src/components/plan-cockpit/PlanCockpit.vue +993 -0
  45. package/src/components/plan-cockpit/PlanCockpitAuditLog.vue +65 -0
  46. package/src/components/plan-cockpit/PlanCockpitDiffPanel.vue +91 -0
  47. package/src/components/plan-cockpit/PlanCockpitHeader.vue +98 -0
  48. package/src/components/plan-cockpit/PlanCockpitImpactPanel.vue +99 -0
  49. package/src/components/plan-cockpit/PlanCockpitKpis.vue +57 -0
  50. package/src/components/plan-cockpit/PlanCockpitVersions.vue +226 -0
  51. package/src/components/plan-cockpit/types.ts +72 -0
  52. package/src/components/plan-create-dialog/PlanCreateDialog.vue +508 -0
  53. package/src/components/plan-detail/PlanAuditLog.vue +59 -0
  54. package/src/components/plan-detail/PlanDetail.vue +1195 -0
  55. package/src/components/plan-detail/PlanDetailHeader.vue +185 -0
  56. package/src/components/plan-detail/PlanDetailKpis.vue +57 -0
  57. package/src/components/plan-detail/PlanTerminateDialog.vue +76 -0
  58. package/src/components/plan-detail/PlanVersionDiffPanel.vue +149 -0
  59. package/src/components/plan-detail/PlanVersionsPanel.vue +255 -0
  60. package/src/components/plan-detail/types.ts +59 -0
  61. package/src/components/plan-list/PlanList.vue +1067 -0
  62. package/src/components/plan-matrix/PlanMatrix.vue +1113 -0
  63. package/src/components/plan-review/PlanReview.vue +742 -0
  64. package/src/components/plan-version-editor/PlanCatalogPreview.vue +184 -0
  65. package/src/components/plan-version-editor/PlanComponentPool.vue +272 -0
  66. package/src/components/plan-version-editor/PlanVersionBasket.vue +281 -0
  67. package/src/components/plan-version-editor/PlanVersionDiffDialog.vue +84 -0
  68. package/src/components/plan-version-editor/PlanVersionEditor.vue +1728 -0
  69. package/src/components/plan-version-editor/PlanVersionEditorHeader.vue +94 -0
  70. package/src/components/plan-version-editor/types.ts +96 -0
  71. package/src/components/wizard-stepper/WizardStepper.vue +107 -0
  72. package/src/create-admin-routes.ts +68 -0
  73. package/src/create-super-admin-app.ts +345 -0
  74. package/src/entitlement-provider.ts +36 -0
  75. package/src/feature-router-guard.ts +77 -0
  76. package/src/http-json.ts +62 -0
  77. package/src/index.ts +98 -0
  78. package/src/manifest-loader.ts +139 -0
  79. package/src/manifest-store-factory.ts +114 -0
  80. package/src/nav-builder.ts +274 -0
  81. package/src/pages-standard/AdminLayout.vue +411 -0
  82. package/src/pages-standard/AdminManifestErrorPage.vue +79 -0
  83. package/src/pages-standard/AuditPage.vue +223 -0
  84. package/src/pages-standard/BundlesPage.vue +910 -0
  85. package/src/pages-standard/BusinessTypesPage.vue +662 -0
  86. package/src/pages-standard/DashboardPage.vue +595 -0
  87. package/src/pages-standard/DiscoveryPage.vue +663 -0
  88. package/src/pages-standard/EmailHistoryPage.vue +576 -0
  89. package/src/pages-standard/MarketingCatalogPage.vue +1771 -0
  90. package/src/pages-standard/PilotsPage.vue +577 -0
  91. package/src/pages-standard/PlanVersionsPage.vue +216 -0
  92. package/src/pages-standard/PlansPage.vue +1222 -0
  93. package/src/pages-standard/PlatformEmailPage.vue +434 -0
  94. package/src/pages-standard/PromoCodeDetailPage.vue +331 -0
  95. package/src/pages-standard/PromoCodesPage.vue +589 -0
  96. package/src/pages-standard/SubscriptionsPage.vue +159 -0
  97. package/src/pages-standard/SuperAdminLoginPage.vue +299 -0
  98. package/src/pages-standard/SuperAdminSetupWizard.vue +405 -0
  99. package/src/pages-standard/TenantDetailPage.vue +432 -0
  100. package/src/pages-standard/TenantsPage.vue +732 -0
  101. package/src/pages-standard/UsersPage.vue +504 -0
  102. package/src/pages-standard/bundles-page/BundleAccordionList.vue +116 -0
  103. package/src/pages-standard/bundles-page/BundleDetailPanel.vue +193 -0
  104. package/src/pages-standard/bundles-page/BundlesFilterBar.vue +48 -0
  105. package/src/pages-standard/bundles-page/BundlesHeader.vue +67 -0
  106. package/src/pages-standard/bundles-page/BundlesKpis.vue +39 -0
  107. package/src/pages-standard/bundles-page/types.ts +15 -0
  108. package/src/pages-standard/discovery-page/CatalogEntryTransPanel.vue +246 -0
  109. package/src/pages-standard/discovery-page/DiscoveryCapList.vue +171 -0
  110. package/src/pages-standard/discovery-page/DiscoveryFeatureCard.vue +410 -0
  111. package/src/pages-standard/discovery-page/DiscoveryHeader.vue +31 -0
  112. package/src/pages-standard/discovery-page/DiscoveryKpis.vue +47 -0
  113. package/src/pages-standard/discovery-page/DiscoveryMetaBanner.vue +26 -0
  114. package/src/pages-standard/discovery-page/DiscoveryQuotaCard.vue +247 -0
  115. package/src/pages-standard/discovery-page/DiscoveryStatusControl.vue +73 -0
  116. package/src/pages-standard/discovery-page/discovery-ui.ts +166 -0
  117. package/src/pages-standard/email-history.types.ts +48 -0
  118. package/src/pages-standard/marketing-catalog/MarketingCatalogAdmin.vue +448 -0
  119. package/src/pages-standard/marketing-catalog/MarketingCatalogHeader.vue +93 -0
  120. package/src/pages-standard/marketing-catalog/MarketingCatalogPreview.vue +138 -0
  121. package/src/pages-standard/marketing-catalog/MarketingCatalogToolbar.vue +58 -0
  122. package/src/pages-standard/marketing-catalog/types.ts +43 -0
  123. package/src/pages-standard/plan-versions/PlanDiffCard.vue +132 -0
  124. package/src/pages-standard/plan-versions/PlanVersionHeader.vue +293 -0
  125. package/src/pages-standard/plan-versions/PlanVersionStatusBadge.vue +48 -0
  126. package/src/pages-standard/plan-versions/PlanVersionsAudit.vue +307 -0
  127. package/src/pages-standard/plan-versions/PlanVersionsDiff.vue +269 -0
  128. package/src/pages-standard/plan-versions/PlanVersionsKpi.vue +65 -0
  129. package/src/pages-standard/plan-versions/PlanVersionsList.vue +292 -0
  130. package/src/pages-standard/plan-versions/PlanVersionsMatrix.vue +261 -0
  131. package/src/pages-standard/plan-versions/PlanVersionsTimeline.vue +300 -0
  132. package/src/pages-standard/plan-versions/VersionDiffPreview.vue +167 -0
  133. package/src/pages-standard/plan-versions/format.ts +53 -0
  134. package/src/pages-standard/plan-versions/types.ts +33 -0
  135. package/src/pages-standard/plans-page/PlanArchiveDialog.vue +50 -0
  136. package/src/pages-standard/plans-page/PlanBundleOverview.vue +147 -0
  137. package/src/pages-standard/plans-page/PlanDiscardDraftDialog.vue +46 -0
  138. package/src/pages-standard/plans-page/PlanPublishDialog.vue +106 -0
  139. package/src/pages-standard/plans-page/PlansPageToast.vue +69 -0
  140. package/src/pages-standard/plans-page/types.ts +18 -0
  141. package/src/pages-standard/platform-email.types.ts +41 -0
  142. package/src/pages-standard/sa-theme.css +223 -0
  143. package/src/pages-standard/tenants/StatusPill.vue +62 -0
  144. package/src/pages-standard/tenants/format.ts +38 -0
  145. package/src/pages-tenant/LimitsRow.vue +67 -0
  146. package/src/pages-tenant/MySubscriptionBundlesPage.vue +604 -0
  147. package/src/pages-tenant/OnboardingConfigurator.vue +417 -0
  148. package/src/pages-tenant/PackageSnapshotPanel.vue +241 -0
  149. package/src/pages-tenant/PendingVersionBanner.vue +126 -0
  150. package/src/pages-tenant/PlanChangeWizard.vue +630 -0
  151. package/src/pages-tenant/TenantPlanSection.vue +729 -0
  152. package/src/pages-tenant/UsageBar.vue +107 -0
  153. package/src/pages-tenant/default-i18n.ts +280 -0
  154. package/src/pages-tenant/tenant-plan-section/BundlePreviewDialog.vue +304 -0
  155. package/src/pages-tenant/tenant-plan-section/TenantBundleStore.vue +323 -0
  156. package/src/pages-tenant/tenant-plan-section/TenantFeatureMatrix.vue +122 -0
  157. package/src/pages-tenant/tenant-plan-section/TenantPlanCardHeader.vue +67 -0
  158. package/src/pages-tenant/tenant-plan-section/TenantUsageGrid.vue +31 -0
  159. package/src/plan-versions-catalog.ts +368 -0
  160. package/src/platform-loaders.ts +68 -0
  161. package/src/project-page-host.ts +108 -0
  162. package/src/testing-e2e/admin-pages-suite.ts +187 -0
  163. package/src/types.ts +58 -0
  164. package/src/use-actions.ts +25 -0
  165. package/src/use-api-list.ts +151 -0
  166. package/src/use-audit-entries.ts +48 -0
  167. package/src/use-batch-columns.ts +59 -0
  168. package/src/use-bulk-publish.ts +150 -0
  169. package/src/use-bundle-versions-map.ts +112 -0
  170. package/src/use-bundles.ts +297 -0
  171. package/src/use-business-types.ts +269 -0
  172. package/src/use-catalog-entries.ts +243 -0
  173. package/src/use-discovery.ts +158 -0
  174. package/src/use-entitlement.ts +87 -0
  175. package/src/use-live-plan-versions.ts +126 -0
  176. package/src/use-manifest.ts +57 -0
  177. package/src/use-marketing-projections.ts +160 -0
  178. package/src/use-nav.ts +33 -0
  179. package/src/use-plan-editor.ts +162 -0
  180. package/src/use-plan-versions.ts +83 -0
  181. package/src/use-plans.ts +375 -0
  182. package/src/use-platform-tenant-actions.ts +286 -0
  183. package/src/use-promotions.ts +126 -0
  184. package/src/use-public-boot.ts +40 -0
  185. package/src/use-subscription-draft.ts +355 -0
  186. package/src/use-super-admin-context.ts +93 -0
  187. package/src/use-tenant-action-flow.ts +238 -0
  188. package/src/use-tenant-billing-catalog.ts +160 -0
  189. package/src/use-tenant-billing.ts +453 -0
  190. package/src/use-tenant-manifest.ts +94 -0
  191. package/src/use-tenant-subscription-bundles.ts +148 -0
  192. package/src/use-tenants.ts +61 -0
  193. package/src/version.ts +10 -0
@@ -0,0 +1,1195 @@
1
+ <template>
2
+ <div class="pd">
3
+ <PlanDetailHeader
4
+ :plan="plan"
5
+ :draft-version="draftVersion"
6
+ :tenant-total="tenantTotal"
7
+ :published-count="publishedCount"
8
+ @back="$emit('back')"
9
+ @delete-plan="$emit('deletePlan')"
10
+ @clone-plan="$emit('clonePlan')"
11
+ @create-draft="$emit('createDraft')"
12
+ @publish="$emit('publish', $event)"
13
+ @update-plan="$emit('updatePlan', $event)"
14
+ />
15
+
16
+ <PlanDetailKpis
17
+ :live-version="liveVersion"
18
+ :draft-version="draftVersion"
19
+ :tenant-total="tenantTotal"
20
+ :version-count="versions.length"
21
+ :published-count="publishedCount"
22
+ />
23
+
24
+ <div class="pd-body">
25
+ <PlanVersionsPanel
26
+ v-model:selected-id="selectedId"
27
+ :chronological="chronological"
28
+ :table-rows="tableRows"
29
+ :draft-version="draftVersion"
30
+ :next-draft-version="nextDraftVersion"
31
+ :timeline-ticks="timelineTicks"
32
+ :impact-by-version="impactByVersion"
33
+ :status-of="statusOf"
34
+ :status-chip="statusChip"
35
+ :editability-of="editabilityOf"
36
+ :format-money="formatMoney"
37
+ :format-date="formatDate"
38
+ @create-draft="$emit('createDraft')"
39
+ @publish="$emit('publish', $event)"
40
+ @edit-draft="$emit('editDraft', $event)"
41
+ @open-terminate="openTerminateDialog"
42
+ />
43
+
44
+ <PlanVersionDiffPanel
45
+ :selected-version="selectedVersion"
46
+ :predecessor="predecessor"
47
+ :diff="diff"
48
+ :diff-rows="diffRows"
49
+ :quota-change-count="quotaChangeCount"
50
+ :status-of="statusOf"
51
+ :quota-count="quotaCount"
52
+ :quotas-of="quotasOf"
53
+ :feature-label="featureLabel"
54
+ :quota-label="quotaLabel"
55
+ :quota-unit="quotaUnit"
56
+ :bundle-label="bundleLabel"
57
+ />
58
+ </div>
59
+
60
+ <PlanTerminateDialog
61
+ v-model="terminateOpen"
62
+ v-model:date-input="terminateDateInput"
63
+ :plan="plan"
64
+ :target="terminateTarget"
65
+ :error="terminateError"
66
+ :terminating="terminating"
67
+ @execute="executeTerminate"
68
+ />
69
+
70
+ <PlanAuditLog
71
+ v-if="auditRows.length > 0 || loadingAudit"
72
+ :audit-rows="auditRows"
73
+ :loading-audit="loadingAudit"
74
+ />
75
+ </div>
76
+ </template>
77
+
78
+ <script setup lang="ts">
79
+ import { computed, ref, watch } from 'vue';
80
+ import {
81
+ isVersionEditable,
82
+ type PlanRow,
83
+ type PlanVersionRow,
84
+ } from '@saasicat/types';
85
+ import PlanAuditLog from './PlanAuditLog.vue';
86
+ import PlanDetailHeader from './PlanDetailHeader.vue';
87
+ import PlanDetailKpis from './PlanDetailKpis.vue';
88
+ import PlanTerminateDialog from './PlanTerminateDialog.vue';
89
+ import PlanVersionDiffPanel from './PlanVersionDiffPanel.vue';
90
+ import PlanVersionsPanel from './PlanVersionsPanel.vue';
91
+ import type {
92
+ AuditRow,
93
+ BundleEntry,
94
+ DiffRow,
95
+ DiscoveryQuota,
96
+ FeatureMeta,
97
+ PlanVersionDiff,
98
+ PlanVersionEditability,
99
+ PlanVersionStatus,
100
+ } from './types.js';
101
+
102
+ // PlanDetail — drill-in for a single plan, 1:1 from the plan simulation
103
+ // (plan-detail.jsx): editable title, KPI cards, version timeline,
104
+ // clickable version table, diff/contents panel per selected version,
105
+ // plus audit log. Replaces the former cockpit as the drill-in.
106
+
107
+ const props = withDefaults(
108
+ defineProps<{
109
+ plan: PlanRow;
110
+ versions: PlanVersionRow[];
111
+ impactByVersion?: Record<number, number>;
112
+ auditRows?: AuditRow[];
113
+ loadingAudit?: boolean;
114
+ availableQuotas?: DiscoveryQuota[];
115
+ availableBundles?: BundleEntry[];
116
+ featureRegistry?: Record<string, FeatureMeta>;
117
+ /**
118
+ * Optional callback for `POST /admin/catalog/plan-versions/:id/terminate`.
119
+ * The platform component delegates the HTTP wiring to the consumer
120
+ * (PlansPage.vue) — see `endsAt` on PlanVersionRow.
121
+ */
122
+ submitTerminate?: (versionId: string, endsAt: string) => Promise<void>;
123
+ }>(),
124
+ {
125
+ impactByVersion: () => ({}),
126
+ auditRows: () => [],
127
+ loadingAudit: false,
128
+ availableQuotas: () => [],
129
+ availableBundles: () => [],
130
+ featureRegistry: () => ({}),
131
+ submitTerminate: undefined,
132
+ },
133
+ );
134
+
135
+ const emit = defineEmits<{
136
+ (e: 'back'): void;
137
+ (e: 'createDraft'): void;
138
+ (e: 'editDraft', version: PlanVersionRow): void;
139
+ (e: 'publish', version: PlanVersionRow): void;
140
+ (e: 'clonePlan'): void;
141
+ (e: 'deletePlan'): void;
142
+ (e: 'updatePlan', patch: { label: string }): void;
143
+ (e: 'terminate', versionId: string, endsAt: string): void;
144
+ }>();
145
+
146
+ // ── Status / Selection ──────────────────────────────────────────────
147
+ function statusOf(v: PlanVersionRow): PlanVersionStatus {
148
+ if (v.publishedAt === null) return 'draft';
149
+ if (v.supersededAt !== null) return 'superseded';
150
+ return 'live';
151
+ }
152
+
153
+ /**
154
+ * Editability decision per version — identical to the backend rule
155
+ * (`isVersionEditable`). The UI uses the result both for the visibility
156
+ * of the edit button and for the badge on published-but-future versions
157
+ * (SPEC_V2 §11.1 M6 Pack 2c).
158
+ */
159
+ function editabilityOf(v: PlanVersionRow): PlanVersionEditability {
160
+ return isVersionEditable(v);
161
+ }
162
+ function statusChip(v: PlanVersionRow): string {
163
+ const s = statusOf(v);
164
+ return s === 'live' ? 'live' : s === 'draft' ? 'draft' : 'supersed';
165
+ }
166
+
167
+ const chronological = computed(() => [...props.versions].sort((a, b) => a.version - b.version));
168
+ const tableRows = computed(() => [...props.versions].sort((a, b) => b.version - a.version));
169
+
170
+ const liveVersion = computed(
171
+ () => props.versions.find((v) => v.publishedAt !== null && v.supersededAt === null) ?? null,
172
+ );
173
+ const draftVersion = computed(() => props.versions.find((v) => v.publishedAt === null) ?? null);
174
+ const publishedCount = computed(() => props.versions.filter((v) => v.publishedAt !== null).length);
175
+ const nextDraftVersion = computed(
176
+ () => props.versions.reduce((m, v) => Math.max(m, v.version), 0) + 1,
177
+ );
178
+ const tenantTotal = computed(() => Object.values(props.impactByVersion).reduce((s, n) => s + n, 0));
179
+
180
+ const newest = computed(() => chronological.value[chronological.value.length - 1] ?? null);
181
+ const selectedId = ref<string | null>(newest.value?.id ?? null);
182
+ watch(newest, (n) => {
183
+ if (!selectedId.value || !props.versions.some((v) => v.id === selectedId.value)) {
184
+ selectedId.value = n?.id ?? null;
185
+ }
186
+ });
187
+
188
+ const selectedVersion = computed(
189
+ () => props.versions.find((v) => v.id === selectedId.value) ?? newest.value,
190
+ );
191
+ const predecessor = computed<PlanVersionRow | null>(() => {
192
+ const sel = selectedVersion.value;
193
+ if (!sel) return null;
194
+ const earlier = chronological.value.filter((v) => v.version < sel.version);
195
+ return earlier.length > 0 ? earlier[earlier.length - 1] : null;
196
+ });
197
+
198
+ // ── Timeline ticks ──────────────────────────────────────────────────
199
+ const timelineTicks = computed(() => {
200
+ const ticks: string[] = [];
201
+ for (const v of chronological.value) {
202
+ if (v.validFrom) ticks.push(v.validFrom.slice(0, 7));
203
+ }
204
+ ticks.push('jetzt');
205
+ return ticks;
206
+ });
207
+
208
+ // ── Money / Quotas ──────────────────────────────────────────────────
209
+ function formatMoney(raw: string | number): string {
210
+ const num = typeof raw === 'string' ? Number(raw) : raw;
211
+ if (!Number.isFinite(num)) return String(raw);
212
+ if (num === 0) return '0 €';
213
+ if (Number.isInteger(num)) return `${num} €`;
214
+ return `${num.toFixed(2).replace('.', ',')} €`;
215
+ }
216
+ function quotasOf(v: PlanVersionRow): Record<string, number> {
217
+ if (v.quotas && Object.keys(v.quotas).length > 0) return v.quotas;
218
+ const legacy: Record<string, number> = {};
219
+ if (typeof v.maxUsers === 'number') legacy.users = v.maxUsers;
220
+ if (typeof v.maxVehicles === 'number') legacy.vehicles = v.maxVehicles;
221
+ if (typeof v.maxStorageGb === 'number') legacy.storageGb = v.maxStorageGb;
222
+ return legacy;
223
+ }
224
+ function quotaCount(v: PlanVersionRow): number {
225
+ return Object.keys(quotasOf(v)).length;
226
+ }
227
+ function featureLabel(key: string): string {
228
+ return props.featureRegistry[key]?.label ?? key;
229
+ }
230
+ function quotaLabel(key: string): string {
231
+ return props.availableQuotas.find((q) => q.quotaKey === key)?.label || key;
232
+ }
233
+ function quotaUnit(key: string): string {
234
+ return props.availableQuotas.find((q) => q.quotaKey === key)?.unit || '';
235
+ }
236
+ function bundleLabel(key: string): string {
237
+ return props.availableBundles.find((b) => b.bundleKey === key)?.label || key;
238
+ }
239
+
240
+ // ── Diff selected vs. predecessor ───────────────────────────────────
241
+ const diff = computed<PlanVersionDiff>(() => {
242
+ const to = selectedVersion.value;
243
+ const from = predecessor.value;
244
+ if (!to || !from) {
245
+ return {
246
+ featuresAdded: [] as string[],
247
+ featuresRemoved: [] as string[],
248
+ quotasAdded: [] as Array<{ key: string; value: number }>,
249
+ quotasRemoved: [] as Array<{ key: string; value: number }>,
250
+ quotasChanged: [] as Array<{ key: string; from: number; to: number }>,
251
+ priceChanged: false,
252
+ };
253
+ }
254
+ const featuresAdded = to.features.filter((f) => !from.features.includes(f));
255
+ const featuresRemoved = from.features.filter((f) => !to.features.includes(f));
256
+ const fromQ = quotasOf(from);
257
+ const toQ = quotasOf(to);
258
+ const quotasAdded: Array<{ key: string; value: number }> = [];
259
+ const quotasRemoved: Array<{ key: string; value: number }> = [];
260
+ const quotasChanged: Array<{ key: string; from: number; to: number }> = [];
261
+ for (const k of new Set([...Object.keys(fromQ), ...Object.keys(toQ)])) {
262
+ const fv = fromQ[k];
263
+ const tv = toQ[k];
264
+ if (fv === undefined && tv !== undefined) quotasAdded.push({ key: k, value: tv });
265
+ else if (fv !== undefined && tv === undefined) quotasRemoved.push({ key: k, value: fv });
266
+ else if (fv !== undefined && tv !== undefined && fv !== tv)
267
+ quotasChanged.push({ key: k, from: fv, to: tv });
268
+ }
269
+ return {
270
+ featuresAdded,
271
+ featuresRemoved,
272
+ quotasAdded,
273
+ quotasRemoved,
274
+ quotasChanged,
275
+ priceChanged: from.monthlyNet !== to.monthlyNet || from.yearlyNet !== to.yearlyNet,
276
+ };
277
+ });
278
+
279
+ const quotaChangeCount = computed(
280
+ () =>
281
+ diff.value.quotasAdded.length +
282
+ diff.value.quotasRemoved.length +
283
+ diff.value.quotasChanged.length,
284
+ );
285
+
286
+ const diffRows = computed<DiffRow[]>(() => {
287
+ const out: DiffRow[] = [];
288
+ for (const f of diff.value.featuresAdded)
289
+ out.push({
290
+ id: 'af-' + f,
291
+ kind: 'add',
292
+ sign: '+',
293
+ tag: 'neu',
294
+ label: featureLabel(f),
295
+ key: f,
296
+ });
297
+ for (const f of diff.value.featuresRemoved)
298
+ out.push({
299
+ id: 'rf-' + f,
300
+ kind: 'rm',
301
+ sign: '−',
302
+ tag: 'entfernt',
303
+ label: featureLabel(f),
304
+ key: f,
305
+ });
306
+ for (const q of diff.value.quotasChanged) {
307
+ const u = quotaUnit(q.key);
308
+ out.push({
309
+ id: 'cq-' + q.key,
310
+ kind: 'mod',
311
+ sign: '~',
312
+ tag: 'geändert',
313
+ label: quotaLabel(q.key),
314
+ key: q.key,
315
+ from: `${q.from} ${u}`.trim(),
316
+ to: `${q.to} ${u}`.trim(),
317
+ });
318
+ }
319
+ for (const q of diff.value.quotasAdded) {
320
+ const u = quotaUnit(q.key);
321
+ out.push({
322
+ id: 'aq-' + q.key,
323
+ kind: 'add',
324
+ sign: '+',
325
+ tag: 'neu',
326
+ label: quotaLabel(q.key),
327
+ key: q.key,
328
+ from: '—',
329
+ to: `${q.value} ${u}`.trim(),
330
+ });
331
+ }
332
+ for (const q of diff.value.quotasRemoved) {
333
+ const u = quotaUnit(q.key);
334
+ out.push({
335
+ id: 'rq-' + q.key,
336
+ kind: 'rm',
337
+ sign: '−',
338
+ tag: 'entfernt',
339
+ label: quotaLabel(q.key),
340
+ key: q.key,
341
+ from: `${q.value} ${u}`.trim(),
342
+ to: '—',
343
+ });
344
+ }
345
+ if (diff.value.priceChanged && selectedVersion.value && predecessor.value) {
346
+ out.push({
347
+ id: 'price',
348
+ kind: 'mod',
349
+ sign: '~',
350
+ tag: 'geändert',
351
+ label: 'Preis (Monat / Jahr)',
352
+ key: 'pricing',
353
+ from: `${formatMoney(predecessor.value.monthlyNet)} / ${formatMoney(predecessor.value.yearlyNet)}`,
354
+ to: `${formatMoney(selectedVersion.value.monthlyNet)} / ${formatMoney(selectedVersion.value.yearlyNet)}`,
355
+ });
356
+ }
357
+ return out;
358
+ });
359
+
360
+ // ── Terminate dialog ────────────────────────────────────────────────
361
+ const terminateOpen = ref(false);
362
+ const terminateTarget = ref<PlanVersionRow | null>(null);
363
+ const terminateDateInput = ref<string>('');
364
+ const terminating = ref(false);
365
+ const terminateError = ref<string | null>(null);
366
+
367
+ function openTerminateDialog(v: PlanVersionRow): void {
368
+ terminateTarget.value = v;
369
+ terminateDateInput.value = v.endsAt ? v.endsAt.slice(0, 10) : '';
370
+ terminateError.value = null;
371
+ terminateOpen.value = true;
372
+ }
373
+
374
+ function formatDate(iso: string | null | undefined): string {
375
+ if (!iso) return '—';
376
+ const d = new Date(iso);
377
+ if (Number.isNaN(d.getTime())) return iso;
378
+ return d.toLocaleDateString('de-DE', {
379
+ day: '2-digit',
380
+ month: '2-digit',
381
+ year: 'numeric',
382
+ });
383
+ }
384
+
385
+ async function executeTerminate(): Promise<void> {
386
+ if (!terminateTarget.value || !terminateDateInput.value) return;
387
+ const dateStr = terminateDateInput.value;
388
+ // Set to end of day: YYYY-MM-DD becomes an ISO timestamp at the end of the day.
389
+ const endsAtIso = new Date(`${dateStr}T23:59:59.000Z`).toISOString();
390
+ terminating.value = true;
391
+ terminateError.value = null;
392
+ try {
393
+ if (props.submitTerminate) {
394
+ await props.submitTerminate(terminateTarget.value.id, endsAtIso);
395
+ } else {
396
+ emit('terminate', terminateTarget.value.id, endsAtIso);
397
+ }
398
+ terminateOpen.value = false;
399
+ terminateTarget.value = null;
400
+ } catch (err: unknown) {
401
+ const e = err as { status?: number; body?: { code?: string; message?: string } };
402
+ const code = e?.body?.code;
403
+ if (code === 'PLAN_TERMINATE_DATE_NOT_FUTURE') {
404
+ terminateError.value = 'Das Datum muss in der Zukunft liegen.';
405
+ } else if (code === 'PLAN_VERSION_NOT_LIVE') {
406
+ terminateError.value =
407
+ 'Diese Version ist nicht live (draft oder superseded) und kann nicht terminiert werden.';
408
+ } else if (code === 'PLAN_TERMINATE_NOT_IMPLEMENTED') {
409
+ terminateError.value =
410
+ 'Backend unterstützt Terminate noch nicht — bitte API-Server neu bauen.';
411
+ } else if (e?.body?.message) {
412
+ terminateError.value = e.body.message;
413
+ } else {
414
+ terminateError.value = err instanceof Error ? err.message : 'Terminate fehlgeschlagen.';
415
+ }
416
+ } finally {
417
+ terminating.value = false;
418
+ }
419
+ }
420
+ </script>
421
+
422
+ <style>
423
+ .pd {
424
+ --primary: #2563eb;
425
+ --border: #e5e7eb;
426
+ --border-strong: #d1d5db;
427
+ --text: #0f172a;
428
+ --text-2: #475569;
429
+ --bg: #f6f7f9;
430
+ --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
431
+ --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
432
+
433
+ padding: 22px 26px;
434
+ background: var(--bg);
435
+ font-family: var(--font-sans);
436
+ color: var(--text);
437
+ min-height: 100%;
438
+ box-sizing: border-box;
439
+ }
440
+ .pd * {
441
+ box-sizing: border-box;
442
+ }
443
+ /* Consumer apps load Quasar, which styles h1–h6 globally with very large
444
+ line-heights. Neutralize that here so headings (and the tier chip
445
+ sitting next to them) are aligned correctly. */
446
+ .pd h1,
447
+ .pd h2,
448
+ .pd h3,
449
+ .pd h4 {
450
+ line-height: 1.2;
451
+ margin: 0;
452
+ }
453
+ .pd-code {
454
+ font: 500 11px var(--font-mono);
455
+ }
456
+
457
+ /* buttons + chips (1:1 styles.css) */
458
+ .btn {
459
+ display: inline-flex;
460
+ align-items: center;
461
+ gap: 7px;
462
+ padding: 8px 14px;
463
+ border-radius: 7px;
464
+ font: 500 13px var(--font-sans);
465
+ cursor: pointer;
466
+ border: 1px solid var(--border-strong);
467
+ background: #fff;
468
+ color: var(--text);
469
+ transition:
470
+ background 0.12s,
471
+ border-color 0.12s;
472
+ }
473
+ .btn:hover {
474
+ background: #f8fafc;
475
+ }
476
+ .btn.primary {
477
+ background: var(--primary);
478
+ border-color: var(--primary);
479
+ color: #fff;
480
+ }
481
+ .btn.primary:hover {
482
+ background: #1d4ed8;
483
+ }
484
+ .btn.btn--sm {
485
+ padding: 5px 9px;
486
+ font-size: 12px;
487
+ gap: 5px;
488
+ }
489
+ .btn.danger {
490
+ border-color: #fecaca;
491
+ color: #b91c1c;
492
+ background: #fff;
493
+ }
494
+ .btn.danger:hover {
495
+ background: #fef2f2;
496
+ border-color: #fca5a5;
497
+ }
498
+ .chip {
499
+ display: inline-flex;
500
+ align-items: center;
501
+ gap: 5px;
502
+ padding: 2px 8px;
503
+ border-radius: 999px;
504
+ font-size: 11px;
505
+ font-weight: 600;
506
+ background: #f8fafc;
507
+ color: var(--text-2);
508
+ border: 1px solid var(--border);
509
+ }
510
+ .chip.live {
511
+ background: #ecfdf5;
512
+ color: #047857;
513
+ border-color: #a7f3d0;
514
+ }
515
+ .chip.draft {
516
+ background: #fffbeb;
517
+ color: #b45309;
518
+ border-color: #fde68a;
519
+ }
520
+ .chip.supersed {
521
+ background: #f1f5f9;
522
+ color: #475569;
523
+ border-color: #cbd5e1;
524
+ }
525
+ .chip.dot::before {
526
+ content: '';
527
+ width: 6px;
528
+ height: 6px;
529
+ border-radius: 50%;
530
+ background: currentColor;
531
+ }
532
+
533
+ /* header */
534
+ .pd-header {
535
+ display: flex;
536
+ align-items: flex-start;
537
+ gap: 18px;
538
+ margin-bottom: 18px;
539
+ }
540
+ .pd-header-left {
541
+ display: flex;
542
+ align-items: flex-start;
543
+ gap: 14px;
544
+ min-width: 0;
545
+ flex: 1;
546
+ }
547
+ .pd-header-titles {
548
+ min-width: 0;
549
+ }
550
+ .pd-back-arrow {
551
+ display: inline-flex;
552
+ transform: rotate(180deg);
553
+ }
554
+ .pd-tier-chip {
555
+ font: 700 10.5px var(--font-mono);
556
+ letter-spacing: 0.08em;
557
+ background: #f1f5f9;
558
+ color: #475569;
559
+ border: 1px solid #e2e8f0;
560
+ padding: 4px 10px;
561
+ border-radius: 6px;
562
+ margin-top: 8px;
563
+ }
564
+ .pd-title {
565
+ font-size: 28px;
566
+ font-weight: 700;
567
+ letter-spacing: -0.025em;
568
+ margin: 0;
569
+ color: var(--text);
570
+ }
571
+ .pd-desc {
572
+ margin-top: 4px;
573
+ font-size: 13px;
574
+ color: var(--text-2);
575
+ }
576
+ .pd-actions {
577
+ display: flex;
578
+ gap: 8px;
579
+ align-items: center;
580
+ }
581
+ .pd-title-wrap {
582
+ display: flex;
583
+ align-items: center;
584
+ gap: 8px;
585
+ }
586
+ .pd-title-edit-btn {
587
+ display: inline-flex;
588
+ align-items: center;
589
+ justify-content: center;
590
+ width: 28px;
591
+ height: 28px;
592
+ border-radius: 6px;
593
+ background: transparent;
594
+ border: 1px solid transparent;
595
+ color: #94a3b8;
596
+ cursor: pointer;
597
+ transition:
598
+ background 0.12s,
599
+ color 0.12s,
600
+ border-color 0.12s;
601
+ }
602
+ .pd-title-edit-btn:hover {
603
+ background: #f1f5f9;
604
+ color: var(--primary);
605
+ border-color: #e2e8f0;
606
+ }
607
+ .pd-title-input {
608
+ font: inherit;
609
+ font-size: 28px;
610
+ font-weight: 700;
611
+ letter-spacing: -0.025em;
612
+ color: var(--text);
613
+ border: 0;
614
+ background: #fffbeb;
615
+ outline: 2px solid #fcd34d;
616
+ padding: 2px 8px;
617
+ border-radius: 6px;
618
+ min-width: 220px;
619
+ }
620
+ .pd-title-hint {
621
+ font-size: 11px;
622
+ color: #92400e;
623
+ font-weight: 500;
624
+ background: #fffbeb;
625
+ border: 1px solid #fde68a;
626
+ padding: 2px 8px;
627
+ border-radius: 999px;
628
+ margin-left: 4px;
629
+ }
630
+
631
+ /* KPI cards */
632
+ .pd-kpis {
633
+ display: grid;
634
+ grid-template-columns: repeat(4, 1fr);
635
+ gap: 12px;
636
+ margin-bottom: 16px;
637
+ }
638
+ .pd-kpi {
639
+ background: #fff;
640
+ border: 1px solid var(--border);
641
+ border-radius: 10px;
642
+ padding: 14px 16px 12px;
643
+ min-height: 102px;
644
+ display: flex;
645
+ flex-direction: column;
646
+ gap: 6px;
647
+ }
648
+ .pd-kpi-label {
649
+ font-size: 10.5px;
650
+ font-weight: 700;
651
+ text-transform: uppercase;
652
+ letter-spacing: 0.1em;
653
+ color: #64748b;
654
+ }
655
+ .pd-kpi-big {
656
+ font: 700 26px/1 var(--font-sans);
657
+ letter-spacing: -0.025em;
658
+ color: var(--text);
659
+ display: flex;
660
+ align-items: center;
661
+ gap: 10px;
662
+ }
663
+ .pd-kpi-sub {
664
+ font-size: 11.5px;
665
+ color: #64748b;
666
+ margin-top: auto;
667
+ }
668
+ .pd-kpi.draft {
669
+ background: linear-gradient(180deg, #fffbeb 0%, #fffef7 100%);
670
+ border-color: #fde68a;
671
+ }
672
+ .pd-kpi.draft .pd-kpi-label,
673
+ .pd-kpi.draft .pd-kpi-sub {
674
+ color: #92400e;
675
+ }
676
+
677
+ /* body */
678
+ .pd-body {
679
+ display: grid;
680
+ grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
681
+ gap: 16px;
682
+ align-items: start;
683
+ }
684
+ .pd-panel {
685
+ background: #fff;
686
+ border: 1px solid var(--border);
687
+ border-radius: 10px;
688
+ overflow: hidden;
689
+ }
690
+ .pd-panel-head {
691
+ display: flex;
692
+ align-items: flex-start;
693
+ gap: 12px;
694
+ padding: 14px 16px 12px;
695
+ border-bottom: 1px solid #f1f5f9;
696
+ }
697
+ .pd-panel-title {
698
+ font-size: 15px;
699
+ font-weight: 700;
700
+ margin: 0;
701
+ letter-spacing: -0.01em;
702
+ color: var(--text);
703
+ }
704
+ .pd-panel-sub {
705
+ font-size: 11.5px;
706
+ color: #64748b;
707
+ margin-top: 3px;
708
+ }
709
+ .pd-panel-head-right {
710
+ margin-left: auto;
711
+ display: flex;
712
+ align-items: center;
713
+ gap: 6px;
714
+ }
715
+
716
+ /* timeline */
717
+ .pd-timeline {
718
+ padding: 14px 16px 6px;
719
+ }
720
+ .pd-timeline-hint {
721
+ display: flex;
722
+ align-items: center;
723
+ gap: 6px;
724
+ font-size: 11px;
725
+ color: #94a3b8;
726
+ margin-bottom: 8px;
727
+ font-weight: 500;
728
+ }
729
+ .pd-timeline-hint svg {
730
+ color: #cbd5e1;
731
+ width: 12px;
732
+ height: 12px;
733
+ }
734
+ .pd-timeline-bar {
735
+ display: flex;
736
+ height: 24px;
737
+ border-radius: 6px;
738
+ overflow: hidden;
739
+ background: #f1f5f9;
740
+ border: 1px solid #e2e8f0;
741
+ }
742
+ .pd-timeline-seg {
743
+ display: flex;
744
+ align-items: center;
745
+ justify-content: center;
746
+ font: 600 11px var(--font-sans);
747
+ color: rgba(15, 23, 42, 0.65);
748
+ border-right: 1px solid rgba(0, 0, 0, 0.06);
749
+ white-space: nowrap;
750
+ padding: 0 8px;
751
+ min-width: 0;
752
+ cursor: pointer;
753
+ transition:
754
+ filter 0.12s,
755
+ transform 0.12s,
756
+ box-shadow 0.15s;
757
+ }
758
+ .pd-timeline-seg:last-child {
759
+ border-right: 0;
760
+ }
761
+ .pd-timeline-seg:hover {
762
+ filter: brightness(0.92);
763
+ transform: translateY(-1px);
764
+ }
765
+ .pd-timeline-seg:active {
766
+ transform: translateY(0);
767
+ }
768
+ .pd-timeline-seg.superseded {
769
+ background: #e2e8f0;
770
+ color: #475569;
771
+ }
772
+ .pd-timeline-seg.live {
773
+ background: #10b981;
774
+ color: #fff;
775
+ font-weight: 700;
776
+ }
777
+ .pd-timeline-seg.draft {
778
+ background: repeating-linear-gradient(135deg, #fde68a 0 8px, #fcd34d 8px 16px);
779
+ color: #78350f;
780
+ font-weight: 700;
781
+ }
782
+ .pd-timeline-seg.is-selected {
783
+ position: relative;
784
+ z-index: 1;
785
+ outline: 2px solid var(--primary);
786
+ outline-offset: -2px;
787
+ box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
788
+ font-weight: 700;
789
+ }
790
+ .pd-timeline-seg.is-selected.superseded {
791
+ color: #0f172a;
792
+ }
793
+ .pd-timeline-seg.is-selected.live {
794
+ outline-color: #047857;
795
+ box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
796
+ }
797
+ .pd-timeline-seg.is-selected.draft {
798
+ outline-color: #b45309;
799
+ box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
800
+ }
801
+ .pd-timeline-ticks {
802
+ display: flex;
803
+ justify-content: space-between;
804
+ margin-top: 6px;
805
+ font: 500 10.5px var(--font-mono);
806
+ color: #94a3b8;
807
+ }
808
+
809
+ /* versions table */
810
+ .pd-versions-tbl {
811
+ display: grid;
812
+ /* minmax(0, …) instead of a bare fr: otherwise the content columns do
813
+ not shrink below their min-content width (long change notes) → the grid
814
+ overflows and the card's overflow:hidden clips it on the right.
815
+ Action column with a fixed minimum width (96px): a bare `auto`
816
+ track collapses to pure padding width in the consumer context, and then
817
+ the draft buttons are cut off. */
818
+ grid-template-columns:
819
+ 64px minmax(0, 1.4fr) minmax(0, 1.1fr) minmax(0, 0.8fr) minmax(0, 1fr)
820
+ minmax(96px, auto);
821
+ align-items: stretch;
822
+ border-top: 1px solid #f1f5f9;
823
+ margin-top: 12px;
824
+ }
825
+ .pd-versions-head {
826
+ display: contents;
827
+ }
828
+ .pd-versions-head > div {
829
+ background: #fbfbfd;
830
+ padding: 9px 12px;
831
+ font-size: 10px;
832
+ text-transform: uppercase;
833
+ letter-spacing: 0.1em;
834
+ color: #64748b;
835
+ font-weight: 700;
836
+ border-bottom: 1px solid var(--border);
837
+ }
838
+ .pd-vrow {
839
+ display: contents;
840
+ cursor: pointer;
841
+ }
842
+ .pd-vrow > div {
843
+ padding: 13px 12px;
844
+ border-bottom: 1px solid #f1f5f9;
845
+ display: flex;
846
+ align-items: center;
847
+ font-size: 12.5px;
848
+ color: var(--text);
849
+ }
850
+ .pd-vrow:hover > div {
851
+ background: #fafbfd;
852
+ }
853
+ .pd-vrow.is-draft > div {
854
+ background: #fffdf5;
855
+ }
856
+ .pd-vrow.is-draft:hover > div {
857
+ background: #fff8e7;
858
+ }
859
+ .pd-vrow.is-selected > div {
860
+ background: #eff6ff !important;
861
+ box-shadow: inset 0 -1px 0 0 #bfdbfe;
862
+ }
863
+ .pd-vrow.is-selected.is-draft > div {
864
+ background: #fff4d6 !important;
865
+ box-shadow: inset 0 -1px 0 0 #fcd34d;
866
+ }
867
+ .pd-vrow.is-selected > div:first-child {
868
+ box-shadow:
869
+ inset 3px 0 0 0 var(--primary),
870
+ inset 0 -1px 0 0 #bfdbfe;
871
+ }
872
+ .pd-vrow.is-draft > div:first-child {
873
+ box-shadow: inset 3px 0 0 0 #f59e0b;
874
+ }
875
+ .pd-vrow.is-selected.is-draft > div:first-child {
876
+ box-shadow:
877
+ inset 3px 0 0 0 #f59e0b,
878
+ inset 0 -1px 0 0 #fcd34d;
879
+ }
880
+ .pd-vcol {
881
+ display: flex;
882
+ flex-direction: column;
883
+ gap: 4px;
884
+ align-items: flex-start;
885
+ }
886
+ .pd-v-num {
887
+ font: 700 14px var(--font-sans);
888
+ }
889
+ .pd-validity {
890
+ display: flex;
891
+ flex-direction: column;
892
+ gap: 2px;
893
+ }
894
+ .pd-validity-line {
895
+ display: flex;
896
+ align-items: center;
897
+ gap: 6px;
898
+ }
899
+ .pd-validity-sub {
900
+ font-size: 10.5px;
901
+ color: #94a3b8;
902
+ }
903
+ .pd-validity-date {
904
+ font: 500 12.5px var(--font-mono);
905
+ }
906
+ .pd-arrow-inf {
907
+ font: 600 13px var(--font-mono);
908
+ color: #94a3b8;
909
+ }
910
+ .pd-pricing-m {
911
+ font: 600 13px var(--font-sans);
912
+ }
913
+ .pd-pricing-y {
914
+ font: 500 10.5px var(--font-sans);
915
+ color: #94a3b8;
916
+ margin-top: 2px;
917
+ }
918
+ .pd-impact-num {
919
+ font: 700 14px var(--font-sans);
920
+ }
921
+ .pd-impact-sub {
922
+ font-size: 10.5px;
923
+ color: #94a3b8;
924
+ }
925
+ .pd-change-note {
926
+ color: #94a3b8;
927
+ font-style: italic;
928
+ overflow: hidden;
929
+ text-overflow: ellipsis;
930
+ white-space: nowrap;
931
+ }
932
+ .pd-row-actions {
933
+ display: flex;
934
+ gap: 6px;
935
+ justify-content: flex-end;
936
+ align-items: center;
937
+ }
938
+ .pd-endsat-badge {
939
+ display: inline-flex;
940
+ align-items: center;
941
+ padding: 3px 8px;
942
+ border-radius: 999px;
943
+ font: 600 10.5px var(--font-mono);
944
+ background: #fffbeb;
945
+ color: #b45309;
946
+ border: 1px solid #fde68a;
947
+ white-space: nowrap;
948
+ }
949
+
950
+ /* diff */
951
+ .pd-diff-chips {
952
+ display: flex;
953
+ gap: 6px;
954
+ }
955
+ .pd-diff-chip {
956
+ font: 700 11px var(--font-mono);
957
+ padding: 3px 8px;
958
+ border-radius: 6px;
959
+ }
960
+ .pd-diff-chip.add {
961
+ background: #ecfdf5;
962
+ color: #047857;
963
+ border: 1px solid #a7f3d0;
964
+ }
965
+ .pd-diff-chip.rm {
966
+ background: #fef2f2;
967
+ color: #b91c1c;
968
+ border: 1px solid #fecaca;
969
+ }
970
+ .pd-diff-chip.mod {
971
+ background: #f1f5f9;
972
+ color: #475569;
973
+ border: 1px solid #e2e8f0;
974
+ }
975
+ .pd-diff-list {
976
+ padding: 12px;
977
+ display: flex;
978
+ flex-direction: column;
979
+ gap: 8px;
980
+ }
981
+ .pd-diff-row {
982
+ display: flex;
983
+ align-items: center;
984
+ gap: 10px;
985
+ background: #fff;
986
+ border: 1px solid var(--border);
987
+ border-radius: 8px;
988
+ padding: 11px 12px 11px 0;
989
+ overflow: hidden;
990
+ }
991
+ .pd-diff-row.add {
992
+ background: linear-gradient(90deg, #ecfdf5 0%, #fff 60%);
993
+ border-color: #a7f3d0;
994
+ }
995
+ .pd-diff-row.rm {
996
+ background: linear-gradient(90deg, #fef2f2 0%, #fff 60%);
997
+ border-color: #fecaca;
998
+ }
999
+ .pd-diff-row.mod {
1000
+ background: linear-gradient(90deg, #f8fafc 0%, #fff 60%);
1001
+ border-color: #e2e8f0;
1002
+ }
1003
+ .pd-diff-icon {
1004
+ width: 32px;
1005
+ align-self: stretch;
1006
+ display: grid;
1007
+ place-items: center;
1008
+ flex: 0 0 32px;
1009
+ color: #fff;
1010
+ font: 700 16px var(--font-sans);
1011
+ }
1012
+ .pd-diff-row.add .pd-diff-icon {
1013
+ background: #10b981;
1014
+ }
1015
+ .pd-diff-row.rm .pd-diff-icon {
1016
+ background: #ef4444;
1017
+ }
1018
+ .pd-diff-row.mod .pd-diff-icon {
1019
+ background: #64748b;
1020
+ }
1021
+ .pd-diff-body {
1022
+ flex: 1;
1023
+ min-width: 0;
1024
+ display: flex;
1025
+ align-items: center;
1026
+ gap: 10px;
1027
+ flex-wrap: wrap;
1028
+ }
1029
+ .pd-diff-kind {
1030
+ font: 700 10px var(--font-mono);
1031
+ text-transform: uppercase;
1032
+ letter-spacing: 0.1em;
1033
+ color: #64748b;
1034
+ }
1035
+ .pd-diff-label {
1036
+ font-size: 13.5px;
1037
+ font-weight: 600;
1038
+ color: var(--text);
1039
+ }
1040
+ .pd-diff-key {
1041
+ font: 500 11px var(--font-mono);
1042
+ color: #94a3b8;
1043
+ }
1044
+ .pd-diff-vals {
1045
+ display: flex;
1046
+ align-items: center;
1047
+ gap: 6px;
1048
+ font: 500 12px var(--font-mono);
1049
+ }
1050
+ .pd-diff-strike {
1051
+ text-decoration: line-through;
1052
+ color: #94a3b8;
1053
+ }
1054
+ .pd-diff-arrow {
1055
+ color: #cbd5e1;
1056
+ }
1057
+ .pd-diff-new {
1058
+ color: #047857;
1059
+ font-weight: 600;
1060
+ }
1061
+ .pd-diff-tag {
1062
+ margin-left: auto;
1063
+ font-size: 11px;
1064
+ font-weight: 600;
1065
+ padding: 2px 9px;
1066
+ border-radius: 999px;
1067
+ border: 1px solid;
1068
+ }
1069
+ .pd-diff-tag.add {
1070
+ background: #fff;
1071
+ color: #047857;
1072
+ border-color: #a7f3d0;
1073
+ }
1074
+ .pd-diff-tag.rm {
1075
+ background: #fff;
1076
+ color: #b91c1c;
1077
+ border-color: #fecaca;
1078
+ }
1079
+ .pd-diff-tag.mod {
1080
+ background: #fff;
1081
+ color: #475569;
1082
+ border-color: #cbd5e1;
1083
+ }
1084
+ .pd-diff-row.plain {
1085
+ background: #fff;
1086
+ border-color: #e2e8f0;
1087
+ padding: 11px 12px 11px 0;
1088
+ }
1089
+ .pd-diff-section {
1090
+ display: flex;
1091
+ align-items: center;
1092
+ gap: 8px;
1093
+ margin-top: 6px;
1094
+ padding: 0 2px;
1095
+ font-size: 10.5px;
1096
+ text-transform: uppercase;
1097
+ letter-spacing: 0.1em;
1098
+ color: #94a3b8;
1099
+ font-weight: 700;
1100
+ }
1101
+ .pd-diff-section:first-child {
1102
+ margin-top: 0;
1103
+ }
1104
+ .pd-diff-section hr {
1105
+ flex: 1;
1106
+ border: 0;
1107
+ border-top: 1px dashed #e2e8f0;
1108
+ }
1109
+ .pd-diff-empty {
1110
+ padding: 28px 18px;
1111
+ text-align: center;
1112
+ color: #94a3b8;
1113
+ font-size: 13px;
1114
+ }
1115
+ .pd-diff-empty b {
1116
+ display: block;
1117
+ color: #475569;
1118
+ font-size: 14px;
1119
+ margin-bottom: 4px;
1120
+ }
1121
+
1122
+ /* audit */
1123
+ .pd-audit {
1124
+ margin-top: 16px;
1125
+ }
1126
+ .pd-audit-body {
1127
+ padding: 4px 16px 14px;
1128
+ }
1129
+ .pd-audit-row {
1130
+ display: flex;
1131
+ align-items: center;
1132
+ gap: 14px;
1133
+ padding: 9px 0;
1134
+ border-top: 1px solid #f1f5f9;
1135
+ }
1136
+ .pd-audit-row:first-child {
1137
+ border-top: 0;
1138
+ }
1139
+ .pd-audit-dot {
1140
+ width: 7px;
1141
+ height: 7px;
1142
+ border-radius: 50%;
1143
+ flex: 0 0 auto;
1144
+ }
1145
+ .pd-audit-draft {
1146
+ background: #f59e0b;
1147
+ }
1148
+ .pd-audit-add {
1149
+ background: #10b981;
1150
+ }
1151
+ .pd-audit-change {
1152
+ background: #2563eb;
1153
+ }
1154
+ .pd-audit-publish {
1155
+ background: #8b5cf6;
1156
+ }
1157
+ .pd-audit-remove {
1158
+ background: #ef4444;
1159
+ }
1160
+ .pd-audit-when {
1161
+ font-size: 11.5px;
1162
+ color: #64748b;
1163
+ min-width: 130px;
1164
+ }
1165
+ .pd-audit-avatar {
1166
+ width: 24px;
1167
+ height: 24px;
1168
+ border-radius: 50%;
1169
+ background: var(--text);
1170
+ color: #fff;
1171
+ display: grid;
1172
+ place-items: center;
1173
+ font: 700 11px var(--font-sans);
1174
+ flex: 0 0 auto;
1175
+ }
1176
+ .pd-audit-who {
1177
+ font-size: 12px;
1178
+ color: var(--text-2);
1179
+ min-width: 64px;
1180
+ }
1181
+ .pd-audit-what {
1182
+ font-size: 13px;
1183
+ color: var(--text);
1184
+ flex: 1;
1185
+ }
1186
+
1187
+ @media (max-width: 1180px) {
1188
+ .pd-body {
1189
+ grid-template-columns: 1fr;
1190
+ }
1191
+ .pd-kpis {
1192
+ grid-template-columns: repeat(2, 1fr);
1193
+ }
1194
+ }
1195
+ </style>