.pdf-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1300;
}

.pdf-preview-panel {
  width: min(760px, 92vw);
  height: min(880px, 90vh);
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.pdf-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #1a447f;
  color: #ffffff;
  flex-shrink: 0;
}

.pdf-preview-title {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-preview-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
  flex-shrink: 0;
}

.pdf-preview-close:hover {
  opacity: 1;
}

.pdf-preview-body {
  flex: 1;
  min-height: 0;
}
.scope-attachment-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.scope-attachment-panel {
  background: var(--app-surface, #fff);
  color: var(--app-text, #101828);
  width: min(720px, 94vw);
  max-height: 85vh;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid var(--app-border, #e4e7ec);
  box-shadow: 0 16px 48px rgba(16, 24, 40, 0.18);
  padding: 0 0 20px;
}

.scope-attachment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 16px 20px;
  background: var(--app-surface-2, #f8fafc);
  border-bottom: 1px solid var(--app-border, #e4e7ec);
  border-radius: 10px 10px 0 0;
}

.scope-attachment-header-title h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--app-accent-text, #1a447f);
}

.scope-attachment-close {
  background: transparent;
  border: none;
  color: var(--app-text-muted, #667085);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scope-attachment-close:hover {
  background: color-mix(in srgb, var(--app-border, #e4e7ec) 60%, transparent);
}

.scope-attachment-upload-section {
  margin: 0 20px 18px;
}

.scope-attachment-list-section {
  margin: 0 20px;
}

.scope-attachment-upload-section h5,
.scope-attachment-list-section h5 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  opacity: 0.75;
}

.scope-attachment-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 22px 16px;
  border-radius: 10px;
  border: 2px dashed var(--app-border, #d0d5dd);
  background: var(--app-surface-2, #f8fafc);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.scope-attachment-dropzone:hover {
  border-color: var(--app-accent, #1a447f);
}

.scope-attachment-dropzone--busy {
  cursor: wait;
  opacity: 0.75;
}

.scope-attachment-dropzone input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.scope-attachment-dropzone-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--app-text, #101828);
}

.scope-attachment-error {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--app-danger, #d32f2f) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--app-danger, #d32f2f) 35%, transparent);
  color: var(--app-danger, #b71c1c);
  font-size: 12px;
}

.scope-attachment-grid {
  height: 280px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--app-border, #e4e7ec);
}

.scope-attachment-file-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.scope-attachment-file-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.scope-attachment-file-name {
  font-size: 13px;
}
.pr-detail-panel {
  position: relative;
  background: var(--app-surface);
  color: var(--app-text);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  border-radius: 10px;
  border: 1px solid var(--app-border);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.pr-detail-panel--empty {
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 140px;
  color: var(--app-text-muted);
}

.pr-detail-panel-empty-icon {
  font-size: 28px;
  opacity: 0.6;
}

.pr-detail-panel--empty p {
  margin: 0;
  font-size: 13px;
}

.pr-detail-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--app-surface-2);
  border-bottom: 1px solid var(--app-border);
  min-width: 0;
}

.pr-detail-panel-header h3 {
  margin: 0;
  font-size: 15px;
  color: var(--app-accent-text);
}

.pr-detail-header-sub {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 3px;
}

.pr-detail-header-badges {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.pr-detail-next-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--app-warning);
  background: color-mix(in srgb, var(--app-warning) 15%, transparent);
  padding: 3px 10px;
  border-radius: 10px;
}

rapid-button.pr-detail-close-button {
  opacity: 0.6;
}
rapid-button.pr-detail-close-button:hover {
  opacity: 1;
}

.pr-detail-action-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--app-accent) 4%, transparent);
  border-bottom: 1px solid var(--app-border);
}

.pr-detail-action-hint {
  font-size: 11.5px;
  opacity: 0.6;
  margin-left: 2px;
}

/* Reject buttons: outline rapid-button tinted to the error tokens. */
rapid-button.pr-detail-btn-danger::part(control) {
  color: var(--app-error);
  border-color: color-mix(in srgb, var(--app-error) 35%, transparent);
}
rapid-button.pr-detail-btn-danger:hover::part(control) {
  background: color-mix(in srgb, var(--app-error) 8%, transparent);
}

.pr-detail-tabs {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  /* Override FAST host grid (auto 1fr auto) so the tablist column cannot expand past the flyout. */
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
}
/* Rapid's .tablist defaults to width:max-content (and display:grid), which clips tabs
   inside a narrow flyout even with scrollable. Force a constrained flex strip so Audit
   (last tab) stays reachable via horizontal scroll. */
.pr-detail-tabs::part(tablist) {
  display: flex !important;
  flex-wrap: nowrap;
  align-items: stretch;
  border-bottom: 1px solid var(--app-border);
  padding: 0 8px;
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.pr-detail-tabs::part(tabpanel) {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pr-detail-tabs rapid-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: 12px;
  padding-inline: 10px;
}

.pr-detail-badge-check {
  color: var(--app-success);
  font-size: 11px;
}
.pr-detail-badge-open {
  color: var(--app-text-muted);
  font-size: 11px;
}

rapid-tab-panel.pr-detail-panel-body {
  flex: 1;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  padding: 16px;
  box-sizing: border-box;
}

/* Overview tab */
.pr-detail-overview {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pr-detail-overview-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.pr-detail-overview-card {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 14px 16px;
}

.pr-detail-overview-card-title {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--app-accent-text);
  font-weight: 700;
}

.pr-detail-field-list {
  display: flex;
  flex-direction: column;
}

.pr-detail-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--app-border);
}
.pr-detail-field-row:last-child {
  border-bottom: none;
}

.pr-detail-field-label {
  font-size: 12px;
  opacity: 0.6;
}

.pr-detail-field-value {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.pr-detail-field-value a {
  color: var(--app-accent-text);
}

.pr-detail-status-pill {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pr-detail-status-pill--indicative,
.pr-detail-status-pill--firm {
  background: color-mix(in srgb, var(--app-warning) 15%, transparent);
  color: var(--app-warning);
}
.pr-detail-status-pill--approved {
  background: color-mix(in srgb, var(--app-success) 15%, transparent);
  color: var(--app-success);
}
.pr-detail-status-pill--rejected {
  background: color-mix(in srgb, var(--app-error) 12%, transparent);
  color: var(--app-error);
}

/* Mini tables (License, PS, Post-Sales) */
.pr-detail-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 8px;
}
.pr-detail-mini-table th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.6;
  background: var(--app-surface-2);
  padding: 8px 10px;
  border-bottom: 1px solid var(--app-border);
}
.pr-detail-mini-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--app-border);
}
.pr-detail-mini-table tr:last-child td {
  border-bottom: none;
}
.pr-detail-mini-table input,
.pr-detail-mini-table select {
  width: 100%;
  max-width: 110px;
  padding: 5px 7px;
  border: 1px solid var(--app-border-strong);
  border-radius: 5px;
  background: var(--app-surface);
  color: inherit;
  font-size: 12.5px;
}

.pr-detail-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--app-text-muted);
  margin: 16px 0 10px;
}
.pr-detail-section-label:first-child {
  margin-top: 0;
}

.pr-detail-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
  margin-bottom: 8px;
}
@media (max-width: 900px) {
  .pr-detail-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pr-detail-totals {
  max-width: 420px;
  margin: 4px 0 8px;
  border-top: 1px solid var(--app-border);
  padding-top: 10px;
}
.pr-detail-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--app-text);
  padding: 4px 0;
}
.pr-detail-totals-row strong {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--app-text);
}
.pr-detail-totals-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pr-detail-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--app-text) 35%, transparent);
  color: color-mix(in srgb, var(--app-text) 55%, transparent);
  font-size: 10px;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
}
.pr-detail-totals-row--divider {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--app-border);
}
.pr-detail-totals-row--grand {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--app-border);
  font-size: 14px;
  font-weight: 600;
  color: var(--app-text);
}
.pr-detail-totals-row--grand strong {
  font-size: 15px;
  color: var(--app-accent-text);
}

.pr-detail-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  /* Grid items must be allowed to shrink below content size or wide controls trample neighbours. */
  min-width: 0;
}
.pr-detail-field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-text-muted);
}
/* Fields are rapid components now — the design system styles their internals; hosts just size. */
.pr-detail-field rapid-text-field,
.pr-detail-field rapid-number-field,
.pr-detail-field rapid-select {
  width: 100%;
  /* rapid-select ships a 250px host min-width — it overflows narrow grid cells (Sales Review inputs). */
  min-width: 0;
}
.pr-detail-field rapid-text-field[readonly],
.pr-detail-field rapid-number-field[readonly] {
  opacity: 0.75;
}

.pr-detail-table-input {
  width: 100%;
  max-width: 140px;
}

.pr-detail-total-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 20px;
  padding: 14px 0 0;
  margin-top: 12px;
  border-top: 1px solid var(--app-border);
  font-size: 13px;
}
.pr-detail-total-footer b {
  font-size: 15px;
}

.pr-detail-component-pricing-hint {
  color: var(--app-text-muted);
  font-weight: 400;
  font-size: 12px;
  white-space: normal;
}

.pr-detail-hint {
  font-size: 11.5px;
  opacity: 0.55;
  display: block;
  margin-bottom: 8px;
}

/* Workflow timeline tab -- mirrors position-keeper's case-details-timeline-* pattern */
.pr-detail-timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pr-detail-timeline-step {
  padding: 10px 0;
  position: relative;
}

.pr-detail-timeline-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 28px;
  bottom: -10px;
  width: 2px;
  background: var(--app-border-strong);
}

.pr-detail-timeline-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pr-detail-timeline-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--app-border-strong);
  flex-shrink: 0;
  z-index: 1;
}

.pr-detail-timeline-step--completed .pr-detail-timeline-marker {
  background: var(--app-success);
}

.pr-detail-timeline-step--current .pr-detail-timeline-marker {
  background: var(--app-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--app-accent) 30%, transparent);
}

.pr-detail-timeline-label {
  font-size: 14px;
  opacity: 0.6;
  min-width: 190px;
}
.pr-detail-timeline-step--completed .pr-detail-timeline-label {
  opacity: 0.85;
}
.pr-detail-timeline-step--current .pr-detail-timeline-label {
  opacity: 1;
  font-weight: 600;
}

.pr-detail-timeline-owner {
  font-size: 12px;
  opacity: 0.6;
  min-width: 130px;
}

.pr-detail-timeline-timestamp {
  font-size: 12px;
  opacity: 0.5;
  min-width: 140px;
}

.pr-detail-timeline-waiting {
  font-size: 11px;
  color: var(--app-warning);
  background: color-mix(in srgb, var(--app-warning) 15%, transparent);
  padding: 2px 8px;
  border-radius: 10px;
}

.pr-detail-timeline-detail {
  margin: 6px 0 4px 24px;
  padding: 8px 12px;
  border-left: 2px solid var(--app-border-strong);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pr-detail-timeline-detail-row {
  display: flex;
  gap: 10px;
  font-size: 12px;
  flex-wrap: wrap;
}
.pr-detail-timeline-detail-action {
  font-weight: 600;
}
.pr-detail-timeline-detail-actor {
  opacity: 0.7;
}
.pr-detail-timeline-detail-timestamp {
  opacity: 0.5;
}
.pr-detail-timeline-detail-comment {
  flex-basis: 100%;
  margin-top: 2px;
  color: var(--app-text);
  font-style: italic;
}

.pr-detail-audit-comment {
  padding: 10px 0;
  border-bottom: 1px solid var(--app-border);
  font-size: 12.5px;
}
.pr-detail-audit-comment:last-child {
  border-bottom: none;
}
.pr-detail-audit-comment-meta {
  color: var(--app-text-muted);
}
.pr-detail-audit-comment-meta b {
  color: var(--app-text);
  font-weight: 600;
}
.pr-detail-audit-comment-text {
  margin-top: 3px;
  color: var(--app-text);
}

/* Hidden data-fetch grids -- never rendered visibly, exists purely to subscribe to live resources
   the way position-keeper's dashboard/case-details components do. */
.pr-detail-hidden-grid {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

/* Comment modal */
.pr-detail-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 25, 0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pr-detail-modal-box {
  width: 100%;
  max-width: 440px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(10, 15, 25, 0.3);
  padding: 20px 22px;
  color: var(--app-text);
}
.pr-detail-modal-box h3 {
  margin: 0 0 3px;
  font-size: 14.5px;
}
.pr-detail-modal-sub {
  font-size: 12px;
  opacity: 0.6;
  margin-bottom: 12px;
}
.pr-detail-modal-box textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 11px;
  border: 1px solid var(--app-border-strong);
  border-radius: 6px;
  background: var(--app-surface-2);
  color: inherit;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}
.pr-detail-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.pr-detail-modal-error {
  color: var(--app-error);
  font-size: 12px;
  margin-top: 8px;
}

/* Margin panel (Sales Review tab) */
.pr-detail-margin-note {
  font-weight: 500;
  opacity: 0.65;
  font-size: 12px;
}

.pr-detail-discount-warning,
.pr-detail-scope-warning {
  margin: 12px 0 4px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--app-warning) 35%, transparent);
  background: color-mix(in srgb, var(--app-warning) 10%, transparent);
  color: var(--app-warning);
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------- Sales Review tab structure ---------- */
/* Review Inputs: 3 equal columns with shared label / control / hint baselines */
.pr-detail-review-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
  margin-bottom: 8px;
  align-items: stretch;
}
.pr-detail-review-inputs .pr-detail-field {
  align-items: stretch;
}
/* Reserve 2 lines so wrapping labels (e.g. Override Licence Total) don’t push controls down */
.pr-detail-review-inputs .pr-detail-field label {
  min-height: 2.6em;
  line-height: 1.3;
}
.pr-detail-review-inputs .pr-detail-field rapid-text-field,
.pr-detail-review-inputs .pr-detail-field rapid-select {
  min-height: 32px;
}
@media (max-width: 900px) {
  .pr-detail-review-inputs {
    grid-template-columns: 1fr;
  }
  .pr-detail-review-inputs .pr-detail-field label {
    min-height: 0;
  }
}

/* Compact tier math under a license component name */
.pr-detail-rate-detail {
  display: block;
  font-size: 11px;
  color: var(--app-text-muted);
  margin-top: 2px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Save row at the foot of the Review Inputs card */
.pr-detail-review-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

/* Emphasised total row at the foot of a summary card (CARR / Once-off) */
.pr-detail-card-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--app-border);
  font-size: 14px;
  font-weight: 600;
  color: var(--app-text);
}

/* Headline: Estimated ACV Year 1 */
.pr-detail-acv-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--app-accent) 30%, transparent);
  background: color-mix(in srgb, var(--app-accent) 8%, transparent);
}
.pr-detail-acv-bar strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--app-accent-fg);
}

.pr-detail-rates-grid {
  height: 260px;
  min-height: 200px;
  margin-bottom: 20px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  overflow: hidden;
}

.pr-detail-rates-grid rapid-grid-pro {
  display: block;
  height: 100%;
  width: 100%;
}

.pr-detail-overview-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pr-detail-overview-card-title-row .pr-detail-overview-card-title {
  margin: 0;
}

.pr-detail-scope-grid {
  height: 220px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  overflow: hidden;
}

.pr-detail-scope-grid rapid-grid-pro {
  display: block;
  height: 100%;
  width: 100%;
}
.blotter-content {
  padding: 20px;
  height: 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--app-canvas);
  color: var(--app-text);
  overflow-x: hidden;
}

.blotter-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.blotter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}

.blotter-btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}
.blotter-btn-primary {
  background: var(--app-accent);
  color: var(--app-on-accent);
}
.blotter-btn-primary:hover {
  background: var(--app-accent-hover);
}
.blotter-btn-outline {
  background: var(--app-surface);
  color: var(--app-text);
  border-color: var(--app-border-strong);
}
.blotter-btn-outline:hover {
  background: var(--app-surface-2);
}
.blotter-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.blotter-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  flex: 1 1 280px;
  min-width: 0;
  width: 100%;
}

.blotter-metric-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-left: 3px solid var(--app-border-strong);
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.blotter-metric-card--total { border-left-color: var(--app-accent); }
.blotter-metric-card--approved { border-left-color: var(--app-success); }
.blotter-metric-card--in-progress { border-left-color: var(--app-warning); }
.blotter-metric-card--rejected { border-left-color: var(--app-error); }

.blotter-metric-card--total .blotter-metric-value { color: var(--app-accent-text); }
.blotter-metric-card--approved .blotter-metric-value { color: var(--app-success); }
.blotter-metric-card--in-progress .blotter-metric-value { color: var(--app-warning); }
.blotter-metric-card--rejected .blotter-metric-value { color: var(--app-error); }

.blotter-metric-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--app-text);
}
.blotter-metric-label {
  font-size: 11px;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.blotter-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.blotter-panel {
  flex: 1;
  min-height: 0;
  background: var(--app-surface);
  border-radius: 10px;
  border: 1px solid var(--app-border);
  box-shadow: 0 1px 3px var(--app-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.blotter-grid-area {
  flex: 1;
  min-height: 0;
}
.blotter-grid-area rapid-grid-pro {
  display: block;
  height: 100%;
  width: 100%;
}
/* Genesis components rendered inside grid cells (via HTML-string cell renderers) */
.blotter-grid-area rapid-progress {
  align-self: center;
}

/* Drill-down flyout: right-hand slide-out panel (rapid-flyout), sized via ::part like the
   reference app. Scoped under .blotter-content so the header's notification flyout is untouched.
   Host defaults to position:absolute + 100vh without inset, so from its static position in the
   blotter it runs off the bottom of the screen — pin it to the viewport instead. */
.blotter-content rapid-flyout {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 2000;
}
.blotter-content rapid-flyout::part(flyout) {
  /* Narrower drawer so the detail tab strip (Audit, etc.) fits / scrolls within the viewport. */
  width: min(720px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  min-width: 0;
  height: 100%;
  max-height: 100dvh;
  box-sizing: border-box;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.blotter-content rapid-flyout::part(content) {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}
/* The flyout's own header only exists to host its internal close/focus button (required for it to
   open without crashing) -- visually the detail panel provides the header, so hide the flyout's.
   Empty footer slot still occupies padding otherwise, so hide that too. */
.blotter-content rapid-flyout::part(header),
.blotter-content rapid-flyout::part(footer) {
  display: none;
}
.blotter-detail-flyout-body {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.blotter-detail-flyout-body .pr-detail-panel {
  border: none;
  border-radius: 0;
  box-shadow: none;
  height: 100%;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
}

/* ---------- Create modal (rapid-modal) ---------- */
.blotter-modal-content {
  min-width: 380px;
  max-width: 460px;
  padding: 4px 2px;
  color: var(--app-text);
}
.blotter-modal-content h3 {
  margin: 0 0 12px;
  font-size: 14.5px;
}
.blotter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}
.blotter-field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.6;
}
.blotter-field rapid-select,
.blotter-field rapid-text-field {
  width: 100%;
}
.blotter-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.blotter-modal-error {
  color: var(--app-error);
  font-size: 12px;
  margin-top: 8px;
}

/* Filter row: segmented status / assignee / product pills (wrap via .blotter-filters) */
.blotter-filter-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.blotter-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.blotter-filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--app-text-muted);
}
.pricing-request-detail-page {
  height: calc(100vh - 48px);
  position: relative;
}
/* Shared visual language for the admin / reference-data screens (PS Rate Card, License Rate Card,
   Hosting Rate Card, Team Templates). Chromium matches Blotter / PricingRequestDetail: Rapid
   controls, --app-* tokens, Card-like panels. */

.admin-hidden-grid {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

.admin-page {
  padding: 20px;
  height: 100%;
  box-sizing: border-box;
  overflow: auto;
  background: var(--app-canvas);
  color: var(--app-text);
}

/* Shell tabs — rapid-segmented-control (same pattern as blotter filters) */
.admin-subtabs {
  display: flex;
  margin-bottom: 16px;
  width: fit-content;
  max-width: 100%;
}

.admin-panel {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 10px;
  box-shadow: 0 1px 3px var(--app-border);
  padding: 18px 20px;
}
.admin-panel h3 {
  margin: 0 0 3px;
  font-size: 14.5px;
}
.admin-panel .admin-desc {
  font-size: 12px;
  opacity: 0.6;
  margin-bottom: 14px;
}

.admin-toolbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.admin-toolbar-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--app-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-mini-table th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.6;
  background: var(--app-surface-2);
  padding: 8px 12px;
  border-bottom: 1px solid var(--app-border);
}
.admin-mini-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--app-border);
  vertical-align: middle;
}
.admin-mini-table tr:last-child td {
  border-bottom: none;
}
.admin-mini-table rapid-number-field,
.admin-mini-table rapid-text-field,
.admin-mini-table rapid-select {
  width: 100%;
  max-width: 160px;
}

/* Role x Region rate-card matrices (Day Rates, Internal Cost Rate Card) */
.admin-matrix-scroll {
  overflow-x: auto;
  max-width: 100%;
}
.admin-matrix-table {
  min-width: max-content;
}
.admin-matrix-table th,
.admin-matrix-table td {
  white-space: nowrap;
}
.admin-matrix-table td rapid-text-field {
  width: 110px;
  max-width: 110px;
}

.admin-actions-row {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-error {
  color: var(--app-error);
  font-size: 12px;
  margin-top: 8px;
}
.admin-success {
  color: var(--app-success);
  font-size: 12px;
  margin-top: 8px;
}

.admin-finance-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--app-warning);
  background: color-mix(in srgb, var(--app-warning) 15%, transparent);
  padding: 3px 10px;
  border-radius: 10px;
  margin-bottom: 10px;
}

/* Two-column admin-list + admin-detail layout (License Rate Card components, Team Templates) */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
}
.admin-list {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 10px;
  box-shadow: 0 1px 3px var(--app-border);
  overflow: hidden;
  align-self: start;
}
.admin-list-item {
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--app-text-muted);
  border-bottom: 1px solid var(--app-border);
  cursor: pointer;
}
.admin-panel-title-pricing-hint {
  font-weight: 400;
  font-size: 13px;
  color: var(--app-text-muted);
  letter-spacing: normal;
  text-transform: none;
}
.admin-list-item:last-child {
  border-bottom: none;
}
.admin-list-item:hover {
  background: var(--app-surface-2);
}
.admin-list-item--active {
  background: color-mix(in srgb, var(--app-accent) 10%, transparent);
  color: var(--app-accent-text);
}
.admin-list-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--app-border);
}
.admin-list-footer rapid-button {
  width: 100%;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
  max-width: 320px;
}
.admin-field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.6;
}
.admin-field rapid-number-field,
.admin-field rapid-text-field,
.admin-field rapid-select,
.admin-field rapid-text-area {
  width: 100%;
}

/* rapid-modal forms (Add Role / Component / Tier / Template / Resource) */
.admin-modal-content {
  min-width: 320px;
  max-width: 480px;
  padding: 4px 2px;
  color: var(--app-text);
}
.admin-modal-content h3 {
  margin: 0 0 12px;
  font-size: 14.5px;
}
.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.admin-modal-error {
  color: var(--app-error);
  font-size: 12px;
  margin-top: 8px;
}
.admin-modal-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-modal-fields .admin-field {
  max-width: none;
  margin-bottom: 10px;
}

.admin-product-select {
  min-width: 200px;
}
.post-sales-tracking-page {
  height: 100%;
  box-sizing: border-box;
}

.post-sales-tracking-skeleton {
  min-height: 280px;
}

.post-sales-tracking-skeleton-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.post-sales-tracking-skeleton-block {
  height: 40px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--app-border) 55%, var(--app-surface-2));
}

.post-sales-tracking-skeleton-block--short {
  width: 55%;
}
.day-rates-content {
  flex: 1;
  min-height: 0;
  padding: 0;
  background: transparent;
}

.day-rates-heading h3 {
  margin: 0 0 3px;
  font-size: 14.5px;
}

.day-rates-heading .admin-desc {
  margin: 0;
}

.day-rates-panel {
  flex: 1;
  min-height: 280px;
}

.day-rates-edit-modal {
  max-width: 420px;
}

.day-rates-edit-modal .admin-modal-fields {
  max-height: min(60vh, 480px);
  overflow-y: auto;
  padding-right: 4px;
}
.ps-rate-card-page {
  height: calc(100vh - 48px);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.license-tiers-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.license-tiers-heading h3 {
  margin: 0 0 3px;
  font-size: 14.5px;
}

.license-tiers-heading .admin-desc {
  margin: 0;
}

.license-tiers-panel {
  flex: 1;
  min-height: 280px;
  margin-top: 12px;
}

.license-tiers-edit-modal {
  max-width: 420px;
}

.license-tiers-edit-modal .admin-modal-fields {
  max-height: min(60vh, 480px);
  overflow-y: auto;
  padding-right: 4px;
}
:host {
  /* insert css styles here */
}
:host {
  /* insert css styles here */
}
.internal-cost-content {
  flex: 1;
  min-height: 0;
  padding: 0;
  background: transparent;
}

.internal-cost-heading h3 {
  margin: 0 0 3px;
  font-size: 14.5px;
}

.internal-cost-heading .admin-desc {
  margin: 0;
}

.internal-cost-heading .admin-finance-badge {
  margin: 6px 0 8px;
}

.internal-cost-panel {
  flex: 1;
  min-height: 280px;
}

.internal-cost-edit-modal {
  max-width: 420px;
}

.internal-cost-edit-modal .admin-modal-fields {
  max-height: min(60vh, 480px);
  overflow-y: auto;
  padding-right: 4px;
}
.license-rate-card-page {
  height: calc(100vh - 48px);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.license-rate-card-page .admin-subtabs {
  flex-shrink: 0;
}
.hosting-tiers-content {
  flex: 1;
  min-height: 0;
  padding: 0;
  background: transparent;
  max-width: 640px;
}

.hosting-tiers-heading h3 {
  margin: 0 0 3px;
  font-size: 14.5px;
}

.hosting-tiers-heading .admin-desc {
  margin: 0;
}

.hosting-tiers-panel {
  flex: 1;
  min-height: 220px;
}
.hosting-rate-card-page {
  height: calc(100vh - 48px);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Product Access extras on top of Blotter.css layout / modal patterns. */

.product-access-toolbar {
  margin-left: auto;
  flex-shrink: 0;
}

/* Product strip at the top of Product Access — wraps like Blotter status pills. */
.product-access-products {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.product-access-filters {
  align-items: center;
}

.blotter-field rapid-combobox,
.blotter-field rapid-switch {
  width: 100%;
}

.product-access-switch-field {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-access-switch-field label {
  margin: 0;
}

.product-access-switch-field rapid-switch {
  width: auto;
}

.product-access-field-hint {
  font-size: 12px;
  opacity: 0.65;
}

/* Visible RapidGridPro (Blotter grid-area pattern). */
.blotter-panel.product-access-panel {
  overflow: hidden;
}

.product-access-panel .blotter-grid-area rapid-boolean-renderer,
.product-access-panel .blotter-grid-area rapid-grid-pro-action-renderer {
  width: 100%;
}
.team-templates-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.team-templates-heading h3 {
  margin: 0 0 3px;
  font-size: 14.5px;
}

.team-templates-heading .admin-desc {
  margin: 0;
}

.team-templates-panel {
  flex: 1;
  min-height: 280px;
  margin-top: 12px;
}

.team-templates-edit-modal {
  max-width: 420px;
}

.team-templates-edit-modal .admin-modal-fields {
  max-height: min(60vh, 480px);
  overflow-y: auto;
  padding-right: 4px;
}
:host {
  /* insert css styles here */
}
.team-templates-page {
  height: calc(100vh - 48px);
  position: relative;
}
._default-layout_10rs1_1 {
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--neutral-fill-stealth-active);
  color: var(--neutral-foreground-rest);
  overflow: hidden;
}

._default-layout_10rs1_1 foundation-header {
  z-index: 999;
  position: absolute;
  top: 0px;
  left: 0px;
  width: 100%;
  max-width: 100%;
  align-items: center;
  border: none;
  /* Must stay visible so Components (and other) nav submenus are not clipped.
   * Note: CSS coerces overflow-y to auto if overflow-x is non-visible, so we cannot
   * combine horizontal scroll with a visible dropdown. */
  overflow: visible;
  box-sizing: border-box;
}

._default-layout_10rs1_1 foundation-header::part(root) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
  flex-wrap: nowrap;
}

._default-layout_10rs1_1 foundation-header::part(logo) {
  max-width: 50px;
  max-height: 24px;
  width: auto;
  height: auto;
  object-fit: contain;
}

._routes-wrapper_10rs1_43 {
  display: flex;
  gap: calc(var(--design-unit) * 2px);
  margin: calc(var(--design-unit) * 1px) 0;
}

._content_10rs1_49 {
  width: 100%;
  flex-grow: 1;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  padding-top: var(--nav-height);
}

@font-face {
  font-family: Segoe UI;
  font-weight: 300;
  src: local("Segoe UI Semilight"), local("Segoe UI");
}

* {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-style: normal;
  font-weight: normal;
}

html,
body,
#root,
[class$='-page'] {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;

  --nav-height: 60px;
}

body{
  overflow: hidden;
}

rapid-design-system-provider,
.dynamic-template,
foundation-router {
  display: flex;
  width: 100%;
  height: 100%;
}

rapid-design-system-provider {
  overflow: hidden;
}

/* App-semantic aliases over the rapid design-system tokens.
   Declared ON the provider element (not :root) because the theme (default.theme.json via applyMode)
   sets token values on the provider — custom properties resolve var() references where they are
   DECLARED, so declaring these at :root would capture platform defaults instead of the theme.
   All page CSS references these aliases; nothing outside this block should hardcode a colour. */
rapid-design-system-provider {
  --app-accent: var(--accent-fill-rest);
  --app-accent-hover: var(--accent-fill-hover);
  /* Text / links / selected labels: use accent-foreground so dark mode stays readable
     (accent-fill is for button backgrounds and is often too dark as body text). */
  --app-accent-text: var(--accent-foreground-rest);
  --app-accent-fg: var(--accent-foreground-rest);
  --app-on-accent: var(--foreground-on-accent-rest);
  --app-canvas: var(--neutral-layer-3);
  --app-surface: var(--neutral-layer-1);
  --app-surface-2: var(--neutral-layer-2);
  --app-text: var(--neutral-foreground-rest);
  --app-text-muted: var(--neutral-foreground-hint);
  --app-border: var(--neutral-stroke-divider-rest);
  --app-border-strong: var(--neutral-stroke-rest);
  --app-hover: var(--neutral-fill-stealth-hover);
  --app-success: var(--success-color);
  --app-warning: var(--warning-color);
  --app-error: var(--error-color);
}