.dp-page, .dp-tab-content { display: block; }

.dp-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

.dp-section { padding: 20px; min-width: 0; border-radius: var(--radius); }
.dp-section h2 { margin: 0 0 4px; font: 650 15px/1.4 var(--font-sans); }
.dp-section h3 { font-size: 14px; margin: 20px 0 10px; }
.dp-section p { font-size: 13px; color: var(--ink-light); margin: 0 0 14px; }

.dp-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dp-form-grid .field { min-width: 0; }
.dp-channel-group { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin: 10px 0; }
.dp-channel-group > button { margin-top: 8px; }
.dp-form-grid input, .dp-form-grid textarea, #data-pipeline-refresh input { width: 100%; }
.dp-combobox { width: 100%; }

.dp-wide { grid-column: 1 / -1; }
.dp-checks { display: flex; flex-wrap: wrap; gap: 16px; margin: 14px 0; font-size: 13px; }
.dp-checks label, .dp-report-choice { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.dp-checks input, .dp-report-choice input { width: auto; margin-top: 3px; }
.dp-report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dp-report-choice { padding: 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; }
.dp-report-choice strong, .dp-report-choice small { display: block; }
.dp-report-choice small { color: var(--ink-light); overflow-wrap: anywhere; margin-top: 3px; }
#data-pipeline-editor .dp-section-head { margin-bottom: 16px; }
.dp-client-fixed { color: var(--ink-light); font-weight: 400; }
.dp-destination { padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-warm); }
.dp-destination-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dp-destination-head h3 { margin: 0; }
.dp-destination-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 14px 0 0; }
.dp-destination-details dt { color: var(--ink-light); font-size: 11px; margin-bottom: 3px; }
.dp-destination-details dd { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.dp-destination > p { margin: 10px 0 0; }
.dp-report-choice:hover { border-color: var(--orange); }
.dp-report-choice:has(input:checked) { border-color: var(--orange-mid); background: var(--orange-pale); }
.dp-report-choice:focus-within { outline: 2px solid var(--orange); outline-offset: 2px; }
.dp-delivery-rules { margin-top: 14px; color: var(--ink-light); font-size: 12px; }
.dp-delivery-rules summary { cursor: pointer; width: fit-content; }
.dp-delivery-rules p { margin: 8px 0 0; font-size: 12px; }
.dp-section .dp-help { margin-top: 8px; }
.dp-filter { width: 320px; max-width: 100%; min-width: 0; margin: 0; }
.dp-delivery-controls { max-width: 100%; }
.dp-delivery-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dp-package-lookup { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-warm); }
.dp-package-lookup .field { flex: 1 1 200px; min-width: 0; margin: 0; }
.dp-package-lookup .ui-small { flex-basis: 100%; margin: 0; }
.dp-matrix-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 0 10px; color: var(--ink-light); font-size: 11px; }
.dp-matrix-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dp-matrix-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.dp-legend-good { background: var(--green-pale); box-shadow: inset 0 0 0 1px var(--green); }
.dp-legend-ready { background: var(--blue-pale); box-shadow: inset 0 0 0 1px var(--blue); }
.dp-legend-wait { background: var(--amber-pale); box-shadow: inset 0 0 0 1px var(--amber); }
.dp-legend-bad { background: var(--red-pale); box-shadow: inset 0 0 0 1px var(--red); }
.dp-delivery-scroll { max-height: 68vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.dp-delivery-matrix { min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.dp-delivery-matrix th, .dp-delivery-matrix td { border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.dp-delivery-matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-warm); white-space: nowrap; }
.dp-delivery-matrix .dp-matrix-name { position: sticky; left: 0; z-index: 1; min-width: 215px; max-width: 260px; padding: 9px 12px; background: var(--surface); border-right: 1px solid var(--border); }
.dp-delivery-matrix thead .dp-matrix-name { z-index: 3; background: var(--surface-warm); }
.dp-delivery-matrix tbody .dp-matrix-name strong, .dp-delivery-matrix tbody .dp-matrix-name small { display: block; }
.dp-delivery-matrix tbody .dp-matrix-name small { margin-top: 3px; color: var(--ink-light); font-weight: 400; }
.dp-delivery-matrix .dp-matrix-day { min-width: 76px; padding: 9px 4px; text-align: center; font-variant-numeric: tabular-nums; }
.dp-delivery-matrix .dp-matrix-day strong, .dp-delivery-matrix .dp-matrix-day small { display: block; }
.dp-delivery-matrix .dp-matrix-day small { color: var(--ink-light); font-weight: 400; }
.dp-delivery-matrix .dp-matrix-cell { min-width: 76px; padding: 3px; text-align: center; }
.dp-day-cell { width: 100%; min-height: 30px; border: 0; border-radius: 5px; padding: 4px 3px; cursor: pointer; font: inherit; font-size: 11px; font-weight: 600; white-space: nowrap; }
.dp-day-cell:hover { box-shadow: inset 0 0 0 2px var(--orange); }
.dp-day-cell:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
/* Delivered days are a quiet tick so the days that need attention carry the words. */
.dp-day-good { color: var(--green); background: var(--green-pale); font-size: 0; }
.dp-day-good::before { content: attr(data-delivery-ticks); font-size: 13px; }
.dp-day-ready { color: var(--blue); background: var(--blue-pale); }
.dp-day-wait { color: var(--amber); background: var(--amber-pale); }
.dp-day-bad { color: var(--red); background: var(--red-pale); }
.dp-day-empty { color: var(--ink-faint); background: var(--surface-warm); font-size: 0; }
.dp-day-empty::before { content: '–'; font-size: 13px; }
.dp-modal.dp-day-modal { width: min(660px, 100%); }
.dp-day-modal .dp-section-head h2 { font-size: 18px; }
.dp-day-modal .dp-section-head p { overflow-wrap: anywhere; }
#dp-day-title:focus:not(:focus-visible) { outline: none; }
.dp-day-body { display: grid; gap: 14px; }
.dp-channel-pills { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.dp-channel-pills .ui-badge { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.dp-day-readiness { font-size: 12px; }
.dp-day-readiness ul { padding-left: 18px; margin: 8px 0 0; }
.dp-day-readiness > div + div { margin-top: 12px; }
.dp-day-status, .dp-package-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 12px; }
.dp-day-panel { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.dp-day-panel p { margin: 10px 0 0; }
.dp-package-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.dp-package-head h3 { margin: 0; font-size: 14px; }
.dp-package-actions { display: flex; gap: 2px; flex-shrink: 0; }
.dp-package-history { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.dp-package-history h4 { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--ink-light); }
.dp-event-timeline { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.dp-event-timeline li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; padding: 5px 0; font-size: 12px; overflow-wrap: anywhere; }
.dp-event-timeline time { color: var(--ink-light); flex-shrink: 0; font-size: 11px; }
.dp-day-modal .dp-modal-actions { margin-top: 0; }
.dp-section .dp-day-loading { margin: 0; font-size: 12px; }
.dp-older-packages h3 { color: var(--ink-light); font-size: 12px; }
.dp-older-packages .data-scroll { margin-top: 10px; }

.dp-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.dp-icon-action {
  width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: middle; border: 1px solid transparent;
  border-radius: var(--radius-sm); background: transparent;
  color: var(--ink-light); cursor: pointer; text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.dp-icon-action:hover { background: var(--surface-warm); color: var(--ink); }
.dp-icon-action:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.dp-icon-action svg {
  width: 17px; height: 17px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.dp-mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; font-size: 11px; }
.dp-muted { display: block; color: var(--ink-light); font-family: inherit; font-size: 11px; margin-top: 4px; }
.dp-error { display: block; color: #a22626; overflow-wrap: anywhere; }

#data-pipeline-refresh .field { max-width: 620px; }

.dp-modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(24,22,38,.4); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 100ms ease; }
.dp-modal-backdrop.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }
.dp-modal { width: min(760px, 100%); max-height: min(90vh, 980px); overflow-y: auto; border: 0; box-shadow: var(--shadow-lg); font-size: 14px; line-height: 1.5; }
.dp-modal .dp-section-head > .btn-ghost { border-color: transparent; color: var(--ink-light); }
.dp-history-modal { width: min(900px, 100%); }
.dp-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
@media (max-width: 900px) {

  .dp-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .dp-form-grid, .dp-report-grid, .dp-destination-details { grid-template-columns: 1fr; }
  .dp-section-head { flex-direction: column; }

  .dp-section { padding: 16px; }
  .dp-event-timeline li { flex-wrap: wrap; gap: 2px 10px; }
}

.dp-legacy-destination { border: 0; padding: 0; margin: 0; min-width: 0; }
#dp-setup-url { width: 100%; }

/* CMS reports reuse management tables, with wrapping and a mobile layout. */
.dp-page, .dp-tab-content { min-width: 0; }
.dp-cms-page { gap: 14px; }

.dp-icon-action:disabled { cursor: default; opacity: .45; }

@keyframes dp-spin { to { transform: rotate(360deg); } }
#dp-panel-finance { container-type: inline-size; }

.dp-icon-action.dp-icon-primary { background: var(--orange); color: white; border-color: var(--orange); }
.dp-icon-action.dp-icon-primary:hover { background: var(--orange-dark); }

.dp-cms-page .dp-icon-action:hover:not(:disabled) { color: var(--orange); background: var(--orange-pale); }
.dp-cms-page .dp-icon-primary:hover:not(:disabled) { color: white; background: var(--orange-dark); }

@container (max-width: 820px) {
  .dp-finance-toolbar { gap: 8px; }
  .dp-finance-table-wrap { border: 0; background: transparent; }
  .dp-finance-table, .dp-finance-table tbody { display: block; }
  .dp-finance-table colgroup { display: none; }
  .dp-finance-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .dp-finance-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .dp-finance-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px; gap: 14px 12px; align-content: start; }
  .dp-finance-table td { display: block; min-width: 0; padding: 0; border: 0; }
  .dp-finance-table td::before { content: attr(data-label); display: block; font-size: 9px; color: var(--ink-light); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
  .dp-finance-table .dp-finance-owner { grid-column: 1 / -1; }
  .dp-finance-table .dp-finance-owner::before, .dp-finance-table .dp-finance-actions::before { display: none; }
  .dp-finance-table .dp-finance-actions { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 8px; }
  .dp-row-actions { gap: 6px; }
  .dp-row-actions .dp-icon-action { width: 32px; height: 32px; background: var(--surface-warm); }
  .dp-finance-empty { grid-column: 1 / -1; }
  .dp-finance-empty td { grid-column: 1 / -1; }
  .dp-finance-empty td::before { display: none; }
}
@container (max-width: 540px) {
  .dp-finance-table tbody { grid-template-columns: minmax(0, 1fr); }
  .dp-finance-stats { gap: 8px 12px; }
}

.dp-channel-picker { border:1px solid var(--border); border-radius:var(--radius-sm); padding:12px; max-height:240px; overflow:auto; }
.dp-channel-picker legend { font-size:12px; font-weight:600; padding:0 4px; }
.dp-channel-picker label { display:flex; align-items:flex-start; gap:8px; padding:7px 0; cursor:pointer; }
.dp-channel-picker input { width:auto; margin-top:3px; accent-color:var(--orange); }
.dp-channel-picker strong,.dp-channel-picker small { display:block; overflow-wrap:anywhere; }
.dp-channel-picker small { font-size:11px; color:var(--ink-light); font-weight:400; }

.dp-modal .dp-section-head { flex-direction:row; }
.dp-modal .dp-section-head > div { min-width:0; }
.dp-modal .dp-section-head > button { flex-shrink:0; }

.dp-channel-scope { border:0; padding:0; margin:10px 0; }
.dp-channel-scope legend { margin-bottom:8px; }

/* Package date lookup shares the portal palette, typography and focus treatment. */
.dp-package-lookup .dp-date-field { position: relative; flex: 0 1 320px; }
.dp-date-control { position: relative; }
.dp-date-control input { padding-right: 42px; }
.dp-date-control input:focus { box-shadow: 0 0 0 3px var(--orange-pale); }
.dp-date-control input[aria-invalid="true"] { border-color: var(--red); }
.dp-date-trigger { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 36px; padding: 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-mid); }
.dp-date-trigger:hover { background: var(--orange-pale); color: var(--orange); }
.dp-date-trigger svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.dp-calendar { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 320px; max-width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 28px #18162624; }
.dp-calendar-head { display: grid; grid-template-columns: 28px minmax(0, 1fr) 70px 28px; align-items: center; gap: 4px; margin-bottom: 10px; }
.dp-calendar-head .ui-icon-button { width: 28px; height: 32px; font-size: 23px; }
.dp-calendar-head .dp-calendar-year { padding: 5px; font-size: 12px; }
.dp-calendar-head .cbx .cbx-input { padding-left: 6px; font-size: 12px; }
.dp-calendar-weekdays, .dp-calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.dp-calendar-weekdays span { padding: 5px 0; text-align: center; color: var(--ink-light); font-size: 11px; }
.dp-calendar-days button { height: 32px; padding: 0; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--ink); font: 500 12px var(--font-sans); }
.dp-calendar-days button.is-muted { color: var(--ink-light); font-weight: 400; }
.dp-calendar-days button.is-today { border-color: var(--orange-mid); }
.dp-calendar-days button:hover { background: var(--orange-pale); color: var(--orange); }
.dp-calendar-days button.is-selected { background: var(--orange); color: white; }
.dp-calendar-footer { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
