/* ==========================================================================
   Loadscape Dealer Portal — design system + components
   Scoped under body.dp to avoid leaking into the public marketing site.
   Built on the existing brand tokens (see scss/base/_variables.scss) and the
   Bootstrap 5.3 grid/JS already enqueued site-wide (inc/scripts.php).
   ========================================================================== */

body.dp {
  /* Brand tokens pulled from the live theme's theme.json (settings.color.palette) */
  --dp-red: #ED1B25;
  --dp-red-dark: #C6141D;
  --dp-red-tint: #FDE9E9;
  --dp-ink: #010101;
  --dp-ink-soft: #2C2C2C;
  --dp-black: #000000;
  --dp-white: #FFFFFF;

  --dp-gray-50: #F5F5F5;
  --dp-gray-100: #EFEFEF;
  --dp-gray-200: #E3E3E3;
  --dp-gray-300: #D2D2D2;
  --dp-gray-400: #9E9E9E;
  --dp-gray-500: #686868;
  --dp-gray-600: #4E4E4E;
  --dp-gray-700: #2C2C2C;

  --dp-success: #00867C;
  --dp-success-bg: #DFF3F1;
  --dp-warning: #B65A0F;
  --dp-warning-bg: #FBEADB;
  --dp-danger: #C6141D;
  --dp-danger-bg: #FBE3E4;
  --dp-info: #0077A8;
  --dp-info-bg: #E1F2FA;
  --dp-neutral-bg: #EFEFEF;
  --dp-neutral-ink: #4E4E4E;

  --dp-focus: #00A6ED;

  --dp-font-display: 'kallisto', 'Arial Narrow', Arial, sans-serif;
  --dp-font-body: 'open-sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --dp-radius-sm: 3px;
  --dp-radius-md: 5px;
  --dp-radius-lg: 8px;
  --dp-radius-pill: 999px;

  --dp-shadow-sm: 0 1px 2px rgba(20, 20, 20, 0.06);
  --dp-shadow-md: 0 6px 20px rgba(20, 20, 20, 0.08);
  --dp-shadow-lg: 0 16px 40px rgba(20, 20, 20, 0.16);

  --dp-sidebar-w: 264px;
  --dp-topbar-h: 68px;

  background: var(--dp-gray-50);
  font-family: var(--dp-font-body);
  color: var(--dp-ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.dp * { box-sizing: border-box; }

body.dp a { color: inherit; text-decoration: none; }
body.dp img { max-width: 100%; display: block; }
body.dp ul { list-style: none; margin: 0; padding: 0; }
body.dp button { font-family: inherit; }

body.dp :focus-visible {
  outline: 2px solid var(--dp-focus);
  outline-offset: 2px;
}

body.dp h1, body.dp h2, body.dp h3, body.dp h4, body.dp h5, body.dp h6 {
  font-family: var(--dp-font-display);
  font-weight: 700;
  color: var(--dp-ink);
  line-height: 1.15;
  margin: 0;
}

body.dp .dp-eyebrow {
  font-family: var(--dp-font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dp-red);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body.dp h1, body.dp h2, body.dp h3 { text-transform: uppercase; letter-spacing: 0.01em; font-weight: 800; }

body.dp .dp-h1 { font-size: 30px; }
body.dp .dp-h2 { font-size: 22px; }
body.dp .dp-h3 { font-size: 18px; }
body.dp .dp-text-muted { color: var(--dp-gray-500); }
body.dp .dp-text-sm { font-size: 13px; }
body.dp .dp-text-xs { font-size: 12px; }

/* ---------------------------------------------------------------------- */
/* Small utility classes (self-contained — no external framework needed)  */
/* ---------------------------------------------------------------------- */
body.dp .d-flex { display: flex; }
body.dp .flex-column { flex-direction: column; }
body.dp .flex-grow-1 { flex: 1 1 auto; }
body.dp .align-items-center { align-items: center; }
body.dp .justify-content-between { justify-content: space-between; }
body.dp .text-center { text-align: center; }
body.dp .mx-auto { margin-left: auto; margin-right: auto; }
body.dp .gap-2 { gap: 8px; }
body.dp .mb-0 { margin-bottom: 0; }
body.dp .mb-1 { margin-bottom: 4px; }
body.dp .mb-2 { margin-bottom: 8px; }
body.dp .mb-3 { margin-bottom: 12px; }
body.dp .mb-4 { margin-bottom: 20px; }
body.dp .mt-2 { margin-top: 8px; }
body.dp .mt-3 { margin-top: 12px; }
body.dp .mt-4 { margin-top: 20px; }
body.dp .pt-4 { padding-top: 20px; }
body.dp .visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */

body.dp .dp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--dp-font-display);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 11px 20px;
  border-radius: var(--dp-radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
  line-height: 1;
}
body.dp .dp-btn:disabled { opacity: .5; cursor: not-allowed; }

body.dp .dp-btn-primary { background: var(--dp-ink); border-color: var(--dp-ink); color: var(--dp-white); }
body.dp .dp-btn-primary:hover:not(:disabled) { background: var(--dp-black); border-color: var(--dp-black); }

body.dp .dp-btn-accent { background: transparent; border-color: var(--dp-red); color: var(--dp-red); }
body.dp .dp-btn-accent:hover:not(:disabled) { background: var(--dp-red); color: var(--dp-white); }

body.dp .dp-btn-secondary { background: var(--dp-white); border-color: var(--dp-gray-300); color: var(--dp-ink); }
body.dp .dp-btn-secondary:hover:not(:disabled) { border-color: var(--dp-ink); }

/* Text-only call to action: red wording, no border, no fill. */
body.dp .dp-btn-link { background: transparent; border-color: transparent; color: var(--dp-red); }
body.dp .dp-btn-link:hover:not(:disabled) { background: transparent; color: var(--dp-red); text-decoration: underline; }
body.dp .dp-btn-ghost { background: transparent; border-color: transparent; color: var(--dp-ink); text-transform: none; font-weight: 600; letter-spacing: 0; }
body.dp .dp-btn-ghost:hover:not(:disabled) { background: var(--dp-gray-100); }

body.dp .dp-btn-danger { background: var(--dp-danger); border-color: var(--dp-danger); color: var(--dp-white); }
body.dp .dp-btn-danger:hover:not(:disabled) { background: #A20F17; border-color: #A20F17; }

body.dp .dp-btn-sm { padding: 7px 14px; font-size: 11.5px; }
body.dp .dp-btn-icon { padding: 8px; width: 34px; height: 34px; }
body.dp .dp-btn-block { width: 100%; }
/* Narrow, centred submit — display:flex (not inline-flex) so the auto margins
   have a block box to centre. min-width keeps it usable when 20% is tiny. */
body.dp .dp-btn-submit {
  display: flex; width: 20%; min-width: 150px; margin-left: auto; margin-right: auto;
}
@media (max-width: 640px) {
  body.dp .dp-btn-submit { width: 100%; }
}

/* Compact row-action icon buttons in tables */
body.dp .dp-row-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--dp-radius-sm);
  color: var(--dp-gray-500); background: transparent; border: 1px solid transparent;
  cursor: pointer; transition: all .15s ease;
}
body.dp .dp-row-action:hover { background: var(--dp-gray-100); color: var(--dp-ink); }
body.dp .dp-row-action.is-danger:hover { background: var(--dp-danger-bg); color: var(--dp-danger); }
body.dp .dp-row-action:disabled { opacity: .45; cursor: not-allowed; }
body.dp .dp-row-action:disabled:hover { background: transparent; color: var(--dp-gray-500); }
/* Bordered variant for the primary action in a row, so an icon-only button
   still reads as something you can click. */
body.dp .dp-row-action.is-outline { border-color: var(--dp-gray-200); }
body.dp .dp-row-action.is-outline:hover { border-color: var(--dp-ink); }

/* ---------------------------------------------------------------------- */
/* Hover/focus tooltip for icon-only buttons.                              */
/* Positioned to the LEFT of the trigger, vertically centred: the tables    */
/* live inside .dp-table-scroll (overflow-x:auto, which makes vertical      */
/* overflow clip as well), so a tooltip above or below the row would be cut */
/* off. Actions is the last column, so leftward always has room.           */
/* ---------------------------------------------------------------------- */
body.dp [data-dp-tip] { position: relative; }
body.dp [data-dp-tip]::after,
body.dp [data-dp-tip]::before {
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .12s ease, visibility .12s ease;
}
body.dp [data-dp-tip]::after {
  content: attr(data-dp-tip);
  position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: var(--dp-ink); color: var(--dp-white);
  font-family: var(--dp-font-body); font-size: 11.5px; font-weight: 600;
  letter-spacing: 0; text-transform: none; line-height: 1.3;
  padding: 5px 9px; border-radius: 5px; white-space: nowrap; z-index: 60;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
body.dp [data-dp-tip]::before {
  content: ""; position: absolute; right: calc(100% + 3px); top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent; border-left-color: var(--dp-ink); z-index: 61;
}
body.dp [data-dp-tip]:hover::after, body.dp [data-dp-tip]:hover::before,
body.dp [data-dp-tip]:focus-visible::after, body.dp [data-dp-tip]:focus-visible::before {
  opacity: 1; visibility: visible;
}
/* Disabled buttons still explain themselves (e.g. the resend cool-off). */
body.dp [data-dp-tip]:disabled:hover::after, body.dp [data-dp-tip]:disabled:hover::before {
  opacity: 1; visibility: visible;
}
/* A cell tooltip carries prose (truncated remarks), so let it wrap. */
body.dp td[data-dp-tip]::after {
  white-space: normal; width: max-content; max-width: 260px; text-align: left;
}

/* Keep the icons in an Actions cell on one tidy row. */
body.dp .dp-cell-actions .dp-action-group {
  display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end;
}
body.dp .dp-cell-actions form { display: inline-flex; margin: 0; }

/* ---------------------------------------------------------------------- */
/* Forms                                                                   */
/* ---------------------------------------------------------------------- */

body.dp .dp-field { margin-bottom: 20px; }
body.dp .dp-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
body.dp .dp-label {
  display: block; font-size: 12.5px; font-weight: 700; color: var(--dp-ink);
  margin-bottom: 7px; letter-spacing: .01em;
}
body.dp .dp-label .dp-optional { font-weight: 400; color: var(--dp-gray-500); text-transform: none; margin-left: 4px; }
body.dp .dp-label .dp-required { font-weight: 400; color: var(--dp-red); text-transform: none; margin-left: 4px; font-size: 11.5px; }
/* Honeypot: off-screen rather than display:none, which some bots skip. */
body.dp .dp-honeypot { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------------------------------------------- */
/* Password field: show/hide eye, strength meter, live rule checklist.     */
/* ---------------------------------------------------------------------- */
body.dp .dp-password-field { position: relative; }
body.dp .dp-password-field .dp-input { padding-right: 46px; }
body.dp .dp-password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--dp-radius-sm);
  background: transparent; color: var(--dp-gray-500); cursor: pointer;
}
body.dp .dp-password-toggle:hover { background: var(--dp-gray-100); color: var(--dp-ink); }
body.dp .dp-password-toggle:focus-visible { outline: 2px solid var(--dp-ink); outline-offset: 1px; }
/* Struck-through eye communicates "currently visible — click to hide". */
body.dp .dp-password-toggle.is-shown { color: var(--dp-ink); }
body.dp .dp-password-toggle.is-shown::after {
  content: ""; position: absolute; left: 7px; right: 7px; top: 50%;
  height: 1.6px; background: currentColor; transform: rotate(-45deg);
}

body.dp .dp-strength { margin-top: 10px; }
body.dp .dp-strength-track {
  height: 5px; border-radius: 999px; background: var(--dp-gray-200); overflow: hidden;
}
body.dp .dp-strength-bar {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: var(--dp-gray-400); transition: width .2s ease, background-color .2s ease;
}
body.dp .dp-strength-bar.is-weak   { background: #d13438; }
body.dp .dp-strength-bar.is-fair   { background: #c98a10; }
body.dp .dp-strength-bar.is-good   { background: #3a7d44; }
body.dp .dp-strength-bar.is-strong { background: #1f6f47; }
body.dp .dp-strength-label { margin-top: 6px; font-size: 12px; color: var(--dp-gray-500); }
body.dp .dp-strength-label strong { color: var(--dp-ink); }

body.dp .dp-match-note { margin-top: 6px; font-size: 12px; font-weight: 600; }
body.dp .dp-match-note.is-ok  { color: #1f6f47; }
body.dp .dp-match-note.is-bad { color: var(--dp-danger, #d13438); }

/* 20px below the list matches the 20px .dp-field margin above it, so the gap
   between the rules and the submit button equals every other field gap. */
body.dp .dp-password-rules { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 2px; }
body.dp .dp-password-rules li {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--dp-gray-500); padding: 3px 0;
}
body.dp .dp-password-rules li svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .35; }
body.dp .dp-password-rules li.is-met { color: #1f6f47; }
body.dp .dp-password-rules li.is-met svg { opacity: 1; }

/* Second-stage account state shown under a request's review status. */
body.dp .dp-activation-state {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 5px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
body.dp .dp-activation-state svg { width: 13px; height: 13px; }
body.dp .dp-activation-state.is-pending { color: #7d5d0f; }
body.dp .dp-activation-state.is-active { color: #1f6f47; }
body.dp .dp-btn:disabled { opacity: .55; cursor: not-allowed; }
/* Sub-label under a split field (the First / Last boxes of Name). */
body.dp .dp-subfield-label {
  display: block; font-size: 12px; font-weight: 400; color: var(--dp-gray-500); margin-top: 6px;
}
body.dp .dp-hint { font-size: 12px; color: var(--dp-gray-500); margin-top: 6px; }
body.dp .dp-error-text { font-size: 12px; color: var(--dp-danger); margin-top: 6px; display: flex; align-items: center; gap: 5px; }

body.dp .dp-input,
body.dp .dp-select,
body.dp .dp-textarea {
  width: 100%;
  font-family: var(--dp-font-body);
  font-size: 14.5px;
  color: var(--dp-ink);
  background: var(--dp-white);
  border: 1.5px solid var(--dp-gray-300);
  border-radius: var(--dp-radius-md);
  padding: 11px 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
body.dp .dp-textarea { resize: vertical; min-height: 96px; }
body.dp .dp-input::placeholder, body.dp .dp-textarea::placeholder { color: var(--dp-gray-400); }
body.dp .dp-input:focus, body.dp .dp-select:focus, body.dp .dp-textarea:focus {
  outline: none; border-color: var(--dp-ink); box-shadow: 0 0 0 3px rgba(20,20,20,0.08);
}
body.dp .dp-field.has-error .dp-input,
body.dp .dp-field.has-error .dp-select,
body.dp .dp-field.has-error .dp-textarea {
  border-color: var(--dp-danger); background: #FFFBFB;
}
body.dp .dp-input:disabled, body.dp .dp-select:disabled { background: var(--dp-gray-50); color: var(--dp-gray-400); cursor: not-allowed; }

/* Date field: a read-only, portal-formatted display ("Sep 17, 2026") with the
   real date input laid transparently on top so the calendar picker still works.
   A native date input always paints its own locale format, which is why the
   visible text is ours and the native control is invisible. */
body.dp .dp-date-field { position: relative; }
body.dp .dp-date-field .dp-input { padding-right: 40px; cursor: pointer; background: var(--dp-white); user-select: none; }
body.dp .dp-date-field .dp-input:read-only { background: var(--dp-white); color: var(--dp-ink); }
body.dp .dp-date-icon {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  color: var(--dp-gray-500); pointer-events: none; display: flex;
}
/* Invisible but still *rendered* — showPicker() refuses to run on a control
   that is display:none or visibility:hidden. pointer-events:none is essential:
   without it this sits on top of the visible box and eats every click. */
body.dp .dp-date-native {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; margin: 0; pointer-events: none;
}
/* The visible box is the focusable one (the native input is tabindex="-1"). */
body.dp .dp-date-field:focus-within .dp-input {
  outline: none; border-color: var(--dp-ink); box-shadow: 0 0 0 3px rgba(20,20,20,0.08);
}

body.dp .dp-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23707070' stroke-width='1.6' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}

body.dp .dp-checkbox-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--dp-ink-soft); }
body.dp .dp-checkbox-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--dp-ink); }

/* Segmented tab toggle (e.g. Upload File / Video Link) */
body.dp .dp-tab-group { display: inline-flex; background: var(--dp-gray-100); border-radius: var(--dp-radius-md); padding: 3px; gap: 2px; }
body.dp .dp-tab {
  border: none; background: transparent; padding: 8px 16px; border-radius: 3px;
  font-family: var(--dp-font-display); font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  color: var(--dp-gray-600); cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
body.dp .dp-tab.is-active { background: var(--dp-white); color: var(--dp-ink); box-shadow: var(--dp-shadow-sm); }

/*
 * The prototype's password-rule list lived here. It targeted the same class as
 * the current one but came later in the file, so its `margin: 10px 0 0` (no
 * bottom margin) overrode the real rule and the submit button collided with the
 * last item — and its li::before drew a second, empty marker beside each tick.
 * The markup it was written for (data-dp-rule) no longer exists. Deleted; the
 * live styles are the .dp-password-rules block further up.
 */

/* ---------------------------------------------------------------------- */
/* Surfaces / cards                                                        */
/* ---------------------------------------------------------------------- */

body.dp .dp-card {
  background: var(--dp-white);
  border: 1px solid var(--dp-gray-200);
  border-radius: var(--dp-radius-lg);
  box-shadow: var(--dp-shadow-sm);
}
body.dp .dp-card-pad { padding: 28px; }
body.dp .dp-card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 24px; border-bottom: 1px solid var(--dp-gray-200);
}
body.dp .dp-card-body { padding: 24px; }

/* ---------------------------------------------------------------------- */
/* Status badges                                                           */
/* ---------------------------------------------------------------------- */

body.dp .dp-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--dp-font-display);
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 5px 10px; border-radius: var(--dp-radius-pill); white-space: nowrap;
}
body.dp .dp-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* ---------------------------------------------------------------------- */
/* Review status chip — icon-led, sentence case, deliberately narrow so     */
/* the requests table fits without a horizontal scrollbar.                  */
/* ---------------------------------------------------------------------- */
body.dp .dp-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--dp-font-body); font-size: 12px; font-weight: 700;
  letter-spacing: 0; text-transform: none; white-space: nowrap;
  padding: 4px 9px 4px 6px; border-radius: var(--dp-radius-pill);
  border: 1px solid transparent;
}
body.dp .dp-status .dp-status-icon { width: 14px; height: 14px; flex-shrink: 0; stroke-width: 2.2; }
body.dp .dp-status.is-approved { background: #e8f5ee; color: #1b6b43; border-color: #c2e3d1; }
body.dp .dp-status.is-applied  { background: #e9f1fb; color: #1e5a99; border-color: #c9ddf4; }
body.dp .dp-status.is-rejected { background: #fdeaec; color: #a3202b; border-color: #f5c9ce; }
body.dp .dp-status.is-hold     { background: #fdf3de; color: #8a6410; border-color: #f2e0b4; }
body.dp .dp-status.is-neutral  { background: var(--dp-gray-100); color: var(--dp-gray-600); border-color: var(--dp-gray-200); }

/* Radio group for picking a video's source. */
body.dp .dp-radio-row { display: flex; flex-wrap: wrap; gap: 10px; }
body.dp .dp-radio-option {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 10px 14px; border: 1px solid var(--dp-gray-200); border-radius: var(--dp-radius-md);
  font-size: 13.5px; font-weight: 600; color: var(--dp-ink); background: var(--dp-white);
  transition: border-color .15s ease, background-color .15s ease;
}
body.dp .dp-radio-option:hover { border-color: var(--dp-gray-400); }
body.dp .dp-radio-option:has(input:checked) { border-color: var(--dp-ink); background: var(--dp-gray-50); }
body.dp .dp-radio-option input { accent-color: var(--dp-red); margin: 0; }

/* ---------------------------------------------------------------------- */
/* Compact variants — used by the Review Request popup so the whole form   */
/* fits one screen and the reviewer never scrolls mid-decision.            */
/* ---------------------------------------------------------------------- */
body.dp .dp-input-sm,
body.dp .dp-select.dp-input-sm { padding: 8px 11px; font-size: 13.5px; }
body.dp .dp-select.dp-input-sm { padding-right: 32px; }
body.dp .dp-textarea-sm { padding: 8px 11px; font-size: 13.5px; min-height: 0; }

body.dp .modal-body.is-compact { padding-top: 14px; padding-bottom: 14px; }
body.dp .modal-body.is-compact .dp-field { margin-bottom: 12px; }
body.dp .modal-body.is-compact .dp-field-row { gap: 14px; }
body.dp .modal-body.is-compact .dp-label { margin-bottom: 4px; font-size: 12px; }
body.dp .modal-body.is-compact .dp-checkbox-row { font-size: 13.5px; }

body.dp .dp-info-list.is-compact .dp-info-row { padding: 6px 0; }
body.dp .dp-info-list.is-compact .dp-info-key,
body.dp .dp-info-list.is-compact .dp-info-value { font-size: 12.5px; }

/* Resource upload form. */
body.dp .dp-form-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
body.dp input[type="file"].dp-input { padding: 9px 12px; line-height: 1.4; cursor: pointer; }
body.dp .dp-current-file {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--dp-gray-50); border: 1px solid var(--dp-gray-200); border-radius: var(--dp-radius-md);
  font-size: 13px; font-weight: 600; color: var(--dp-ink);
}

/* ---------------------------------------------------------------------- */
/* Account settings                                                        */
/* ---------------------------------------------------------------------- */
body.dp .dp-account-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start;
}
body.dp .dp-account-aside { position: sticky; top: 20px; }
@media (max-width: 900px) {
  body.dp .dp-account-grid { grid-template-columns: 1fr; }
  body.dp .dp-account-aside { position: static; }
}

/* A field the user may read but not edit. */
body.dp .dp-locked-field { position: relative; }
body.dp .dp-locked-field .dp-input { padding-right: 40px; background: var(--dp-gray-50); color: var(--dp-gray-600); cursor: not-allowed; }
body.dp .dp-locked-icon {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  display: flex; color: var(--dp-gray-400);
}
body.dp .dp-locked-icon svg { width: 16px; height: 16px; }

/* Dealer code shown inline in the Dealer cell rather than its own column. */
body.dp .dp-code-chip {
  display: inline-block; margin-right: 6px; padding: 1px 6px;
  background: var(--dp-gray-100); border-radius: 4px;
  font-size: 11px; font-weight: 700; color: var(--dp-gray-600); letter-spacing: .01em;
}
body.dp .dp-verified-mark {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: #1b6b43;
}
body.dp .dp-verified-mark svg { width: 14px; height: 14px; stroke-width: 2.4; }
/* Long values stay on one line instead of widening the table. */
body.dp .dp-cell-truncate {
  display: block; max-width: 210px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.dp .dp-badge-active { background: var(--dp-success-bg); color: var(--dp-success); }
body.dp .dp-badge-active::before { background: var(--dp-success); }
body.dp .dp-badge-inactive { background: var(--dp-neutral-bg); color: var(--dp-neutral-ink); }
body.dp .dp-badge-inactive::before { background: var(--dp-gray-400); }
body.dp .dp-badge-pending { background: var(--dp-warning-bg); color: var(--dp-warning); }
body.dp .dp-badge-pending::before { background: var(--dp-warning); }
body.dp .dp-badge-draft { background: var(--dp-info-bg); color: var(--dp-info); }
body.dp .dp-badge-draft::before { background: var(--dp-info); }
body.dp .dp-badge-archived { background: var(--dp-gray-100); color: var(--dp-gray-500); }
body.dp .dp-badge-archived::before { background: var(--dp-gray-400); }
body.dp .dp-badge-danger { background: var(--dp-danger-bg); color: var(--dp-danger); }
body.dp .dp-badge-danger::before { background: var(--dp-danger); }

body.dp .dp-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--dp-ink-soft);
  background: var(--dp-gray-100); border-radius: var(--dp-radius-pill); padding: 6px 12px 6px 8px;
}
body.dp .dp-chip .dp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dp-red); }

/* Library-origin tag (shared vs private) */
body.dp .dp-origin-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
body.dp .dp-origin-tag.is-shared { color: var(--dp-info); }
body.dp .dp-origin-tag.is-private { color: var(--dp-red); }
body.dp .dp-origin-tag .dp-origin-icon { width: 14px; height: 14px; }

/* ---------------------------------------------------------------------- */
/* Auth shell (Request access / Pending / Activate / Login)                */
/* ---------------------------------------------------------------------- */

body.dp.dp-auth { background: var(--dp-gray-50); min-height: 100vh; display: flex; flex-direction: column; }
body.dp .dp-auth-header {
  padding: 22px 32px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--dp-gray-200); background: var(--dp-white);
}
body.dp .dp-auth-logo img { height: 34px; width: auto; }
body.dp .dp-auth-header-link { font-size: 13.5px; color: var(--dp-gray-600); }
body.dp .dp-auth-header-link strong { color: var(--dp-ink); font-weight: 700; margin-left: 5px; }
body.dp .dp-auth-header-link a { color: var(--dp-red); font-weight: 700; }
body.dp .dp-auth-header-link a:hover { text-decoration: underline; }

body.dp .dp-auth-main { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 56px 20px 70px; }
body.dp .dp-auth-card { width: 100%; max-width: 480px; }
/* Request Access carries side-by-side fields, so it gets a wider card. Scoped
   to that screen so Sign In / Pending / Activation keep their narrow layout. */
body.dp .dp-auth-card.is-request { max-width: 66.6%; }
body.dp .dp-auth-card.is-wide { max-width: 620px; }
body.dp .dp-auth-title { margin-bottom: 8px; }
body.dp .dp-auth-subtitle { color: var(--dp-gray-500); font-size: 14px; margin-bottom: 28px; line-height: 1.6; }

body.dp .dp-auth-footer { text-align: center; padding: 20px; font-size: 12.5px; color: var(--dp-gray-400); }

/* Status stepper used on the pending-verification screen */
body.dp .dp-steps { display: flex; align-items: center; gap: 0; margin: 4px 0 28px; }
body.dp .dp-step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
body.dp .dp-step-dot {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--dp-gray-100); color: var(--dp-gray-500); font-family: var(--dp-font-display); font-weight: 700; font-size: 12px;
  border: 2px solid var(--dp-gray-200); z-index: 1;
}
body.dp .dp-step-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--dp-gray-500); margin-top: 8px; text-align: center; }
body.dp .dp-step::after {
  content: ''; position: absolute; top: 14px; left: 50%; width: 100%; height: 2px; background: var(--dp-gray-200); z-index: 0;
}
body.dp .dp-step:last-child::after { display: none; }
body.dp .dp-step.is-done .dp-step-dot { background: var(--dp-ink); border-color: var(--dp-ink); color: var(--dp-white); }
body.dp .dp-step.is-done::after { background: var(--dp-ink); }
body.dp .dp-step.is-current .dp-step-dot { background: var(--dp-white); border-color: var(--dp-red); color: var(--dp-red); }
body.dp .dp-step.is-current .dp-step-label { color: var(--dp-ink); }

body.dp .dp-info-list { display: grid; gap: 0; }
body.dp .dp-info-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--dp-gray-100); font-size: 13.5px; }
body.dp .dp-info-row:last-child { border-bottom: 0; }
body.dp .dp-info-row .dp-info-key { color: var(--dp-gray-500); }
body.dp .dp-info-row .dp-info-value { color: var(--dp-ink); font-weight: 600; text-align: right; }

body.dp .dp-callout {
  display: flex; gap: 12px; padding: 16px; border-radius: var(--dp-radius-md);
  background: var(--dp-gray-50); border: 1px solid var(--dp-gray-200); font-size: 13px; color: var(--dp-gray-600); line-height: 1.6;
}
body.dp .dp-callout.is-success { background: var(--dp-success-bg); border-color: transparent; color: #04564F; }
body.dp .dp-callout.is-warning { background: var(--dp-warning-bg); border-color: transparent; color: #7A3E0A; }
body.dp .dp-callout-icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }

body.dp .dp-success-mark {
  width: 56px; height: 56px; border-radius: 50%; background: var(--dp-success-bg); color: var(--dp-success);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}

/* ---------------------------------------------------------------------- */
/* App shell                                                               */
/* ---------------------------------------------------------------------- */

body.dp.dp-app { display: flex; min-height: 100vh; }

body.dp .dp-sidebar {
  width: var(--dp-sidebar-w); flex-shrink: 0; background: var(--dp-ink);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 40;
  transition: transform .2s ease;
}
body.dp .dp-sidebar-head {
  display: flex; align-items: center; gap: 6px; padding-right: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0;
}
body.dp .dp-sidebar-brand { padding: 20px 22px; display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }

body.dp .dp-sidebar-collapse {
  flex-shrink: 0; background: none; border: none; cursor: pointer; line-height: 0;
  padding: 7px; border-radius: var(--dp-radius-sm); color: var(--dp-gray-400);
  transition: background-color .15s ease, color .15s ease;
}
body.dp .dp-sidebar-collapse:hover { background: rgba(255,255,255,0.08); color: var(--dp-white); }
body.dp .dp-sidebar-collapse:focus-visible { outline: 2px solid var(--dp-red); outline-offset: 1px; }
body.dp .dp-sidebar-collapse .dp-collapse-out { display: none; }
body.dp.dp-sidebar-collapsed .dp-sidebar-collapse .dp-collapse-in { display: none; }
body.dp.dp-sidebar-collapsed .dp-sidebar-collapse .dp-collapse-out { display: block; }

/* The nav is taller than a laptop viewport once every category is listed, so
   it scrolls on its own while the brand and the user card stay pinned. */
body.dp .dp-sidebar-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.22) transparent;
}
body.dp .dp-sidebar-scroll::-webkit-scrollbar { width: 8px; }
body.dp .dp-sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
body.dp .dp-sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 4px; }
body.dp .dp-sidebar-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.32); }
body.dp .dp-sidebar-brand-mark { display: inline-flex; background: var(--dp-white); border-radius: var(--dp-radius-sm); padding: 6px 10px; line-height: 0; }
body.dp .dp-sidebar-brand-mark img {width: auto; display: block; }
body.dp .dp-sidebar-brand-text { font-family: var(--dp-font-display); font-weight: 700; color: var(--dp-gray-400); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

/* Sidebar vertical rhythm, kept deliberately uniform:
   - 2px between sibling rows (link/link, sublink/sublink, link/its sublinks)
   - 15px wherever a new top-level block starts, whether that is across a group
     divider or straight after a subgroup ends.
   The group padding is symmetric so the divider sits centred in its gap. */
body.dp .dp-nav-group { padding: 6px 14px; }
/* The groups carry no headings, so a hairline keeps them reading as groups. */
body.dp .dp-nav-group + .dp-nav-group { border-top: 1px solid rgba(255,255,255,0.07); }
body.dp .dp-nav-link {
  display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: var(--dp-radius-md);
  color: var(--dp-gray-300); font-size: 13.5px; font-weight: 600; margin-bottom: 2px; border-left: 3px solid transparent;
  line-height: 1.3;
  transition: background-color .15s ease, color .15s ease;
}
body.dp .dp-nav-link .dp-nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
body.dp .dp-nav-link:hover { background: rgba(255,255,255,0.06); color: var(--dp-white); }
body.dp .dp-nav-link.is-active { background: rgba(237,27,37,0.14); color: var(--dp-white); border-left-color: var(--dp-red); }
body.dp .dp-nav-link.is-active .dp-nav-icon { opacity: 1; }

/* 15px below matches the gap a group divider produces, so a top-level link
   following a subgroup sits exactly as far down as one starting a new group. */
body.dp .dp-nav-subgroup { margin: 2px 0 15px 22px; padding-left: 11px; border-left: 1px solid rgba(255,255,255,0.1); }
body.dp .dp-nav-sublink {
  display: block; padding: 5px 10px; border-radius: var(--dp-radius-sm);
  color: #c0b1b1; font-size: 12.5px; font-weight: 600; margin-bottom: 2px; line-height: 1.35;
  transition: background-color .15s ease, color .15s ease;
}
body.dp .dp-nav-sublink:hover { background: rgba(255,255,255,0.06); color: var(--dp-white); }
body.dp .dp-nav-sublink.is-active { color: var(--dp-white); }

/* A nested link that opens its own screen rather than filtering the parent.
   Deliberately styled no differently: it reads as one of the list. */

/* ---------------------------------------------------------------------- */
/* Collapsed sidebar (icon rail)                                           */
/* Everything keys off one custom property: .dp-sidebar and .dp-main both  */
/* size from --dp-sidebar-w, so redefining it on <body> moves both.        */
/* ---------------------------------------------------------------------- */
body.dp.dp-sidebar-collapsed { --dp-sidebar-w: 74px; }

/* flex:none because the head turns into a column here — flex:1 would stretch
   the brand down the full height instead of sitting above the toggle. */
body.dp.dp-sidebar-collapsed .dp-sidebar-brand { padding: 18px 0 10px; justify-content: center; flex: none; width: 100%; }
body.dp.dp-sidebar-collapsed .dp-sidebar-brand-text { display: none; }
body.dp.dp-sidebar-collapsed .dp-sidebar-brand-mark { padding: 6px; }
/* The toggle moves under the logo — side by side there is no room for both. */
body.dp.dp-sidebar-collapsed .dp-sidebar-head { flex-direction: column; gap: 0; padding: 0 0 10px; }

body.dp.dp-sidebar-collapsed .dp-nav-group { padding: 6px 10px; }
/*
 * font-size:0 is what hides the labels: they are bare text nodes beside the
 * icon, not wrapped in an element that could be display:none'd. The icons are
 * SVGs with explicit width/height, so they are unaffected.
 */
body.dp.dp-sidebar-collapsed .dp-nav-link {
  font-size: 0; gap: 0; justify-content: center; padding: 10px 0;
  border-left: none; border-right: 3px solid transparent;
}
body.dp.dp-sidebar-collapsed .dp-nav-link.is-active { border-right-color: var(--dp-red); }
/* Sub-links have no icon of their own, so they would collapse to blanks. */
body.dp.dp-sidebar-collapsed .dp-nav-subgroup { display: none; }

/*
 * The labels come back as native browser tooltips, set from data-dp-nav-label
 * by portal.js while collapsed. Deliberately NOT the portal's own CSS tooltip:
 * .dp-sidebar-scroll sets overflow-y, which forces overflow-x to auto, so a
 * pseudo-element sitting outside the rail would be clipped by the scroll box.
 */

body.dp .dp-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--dp-red); color: var(--dp-white);
  display: flex; align-items: center; justify-content: center; font-family: var(--dp-font-display); font-weight: 700; font-size: 12.5px; flex-shrink: 0;
}

body.dp .dp-main { flex: 1; margin-left: var(--dp-sidebar-w); display: flex; flex-direction: column; min-width: 0; }

body.dp .dp-topbar {
  height: var(--dp-topbar-h); background: var(--dp-white); border-bottom: 1px solid var(--dp-gray-200);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 30; gap: 16px;
}
body.dp .dp-topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
body.dp .dp-breadcrumbs { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--dp-gray-500); flex-wrap: wrap; }
body.dp .dp-breadcrumbs a:hover { color: var(--dp-ink); text-decoration: underline; }
body.dp .dp-breadcrumbs .dp-crumb-current { color: var(--dp-ink); font-weight: 700; }
body.dp .dp-breadcrumbs .dp-crumb-sep { color: var(--dp-gray-300); }

body.dp .dp-topbar-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
body.dp .dp-dealer-chip {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--dp-radius-pill);
  background: var(--dp-gray-50); border: 1px solid var(--dp-gray-200); font-size: 12px;
}
body.dp .dp-dealer-chip strong { color: var(--dp-ink); font-weight: 700; }
body.dp .dp-dealer-chip span { color: var(--dp-gray-500); }
body.dp .dp-dealer-chip .dp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dp-red); flex-shrink: 0; }

/* ----------------------------------------------------------------------- */
/* Top-bar avatar + account menu                                           */
/* ----------------------------------------------------------------------- */
body.dp .dp-user-menu { position: relative; flex-shrink: 0; }

body.dp .dp-user-menu-trigger {
  display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px;
  background: none; border: 1px solid transparent; border-radius: var(--dp-radius-pill);
  cursor: pointer; font: inherit; color: inherit; text-align: left;
}
body.dp .dp-user-menu-trigger:hover,
body.dp .dp-user-menu.is-open .dp-user-menu-trigger { background: var(--dp-gray-50); border-color: var(--dp-gray-200); }
body.dp .dp-user-menu-trigger:focus-visible { outline: 2px solid var(--dp-red); outline-offset: 2px; }

body.dp .dp-user-menu-text { display: flex; flex-direction: column; min-width: 0; }
body.dp .dp-user-menu-trigger .dp-user-menu-name { color: var(--dp-ink); font-size: 12.5px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
body.dp .dp-user-menu-trigger .dp-user-menu-meta { color: var(--dp-gray-500); font-size: 11px; line-height: 1.3; white-space: nowrap; }

body.dp .dp-user-menu-caret { color: var(--dp-gray-500); width: 15px; height: 15px; transition: transform .16s ease; }
body.dp .dp-user-menu.is-open .dp-user-menu-caret { transform: rotate(180deg); }

body.dp .dp-user-menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 232px; z-index: 60;
  background: var(--dp-white); border: 1px solid var(--dp-gray-200); border-radius: var(--dp-radius-md);
  box-shadow: var(--dp-shadow-lg); padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-5px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
/*
 * Bridges the 8px gap under the trigger so the menu does not snap shut as the
 * pointer travels from the avatar down into the panel.
 */
body.dp .dp-user-menu-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 9px; }

body.dp .dp-user-menu:hover .dp-user-menu-panel,
body.dp .dp-user-menu:focus-within .dp-user-menu-panel,
body.dp .dp-user-menu.is-open .dp-user-menu-panel { opacity: 1; visibility: visible; transform: translateY(0); }

body.dp .dp-user-menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--dp-gray-200); margin-bottom: 6px; }
body.dp .dp-user-menu-head .dp-user-menu-name { color: var(--dp-ink); font-size: 13px; font-weight: 700; line-height: 1.35; }
body.dp .dp-user-menu-head .dp-user-menu-meta { color: var(--dp-gray-500); font-size: 11.5px; line-height: 1.35; }

body.dp .dp-user-menu-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--dp-radius-sm);
  color: var(--dp-gray-600); font-size: 13px; font-weight: 600;
}
body.dp .dp-user-menu-item .dp-icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--dp-gray-500); }
body.dp .dp-user-menu-item:hover { background: var(--dp-gray-50); color: var(--dp-ink); }
body.dp .dp-user-menu-item:hover .dp-icon { color: var(--dp-ink); }

/* Sign Out is the destructive, final action: set apart by a rule above it and
   carried in the brand red so it never reads as one more neutral link. */
body.dp .dp-user-menu-item.is-signout {
  margin-top: 6px; border-top: 1px solid var(--dp-gray-200); border-radius: 0 0 var(--dp-radius-sm) var(--dp-radius-sm);
  padding-top: 11px; color: var(--dp-red); font-weight: 700;
}
body.dp .dp-user-menu-item.is-signout .dp-icon { color: var(--dp-red); }
body.dp .dp-user-menu-item.is-signout:hover { background: var(--dp-red); color: var(--dp-white); }
body.dp .dp-user-menu-item.is-signout:hover .dp-icon { color: var(--dp-white); }

body.dp .dp-sidebar-toggle { display: none; background: none; border: none; padding: 6px; color: var(--dp-ink); cursor: pointer; }

body.dp .dp-content { padding: 30px 32px 60px; max-width: 1360px; width: 100%; margin: 0 auto; }

body.dp .dp-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
body.dp .dp-page-header-text .dp-h1 { margin-bottom: 6px; }
body.dp .dp-page-header-actions { display: flex; gap: 10px; flex-shrink: 0; }
body.dp .dp-page-subtitle { color: var(--dp-gray-500); font-size: 14px; max-width: 640px; }
/* For list-led screens, where the heading should not push the table down. */
body.dp .dp-page-header.is-tight { margin-bottom: 18px; }
body.dp .dp-page-header.is-tight .dp-h1 { font-size: 26px; }

/* Sidebar overlay for mobile */
body.dp .dp-sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(10,10,10,0.45); z-index: 39;
}
body.dp.dp-sidebar-open .dp-sidebar-overlay { display: block; }

/* ---------------------------------------------------------------------- */
/* Stat cards (dashboard)                                                  */
/* ---------------------------------------------------------------------- */

body.dp .dp-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
body.dp .dp-stat-card { background: var(--dp-white); border: 1px solid var(--dp-gray-200); border-radius: var(--dp-radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
body.dp .dp-stat-top { display: flex; align-items: center; justify-content: space-between; }
body.dp .dp-stat-icon {
  width: 34px; height: 34px; border-radius: var(--dp-radius-md); display: flex; align-items: center; justify-content: center;
  background: var(--dp-gray-50); color: var(--dp-ink);
}
body.dp .dp-stat-value { font-family: var(--dp-font-display); font-size: 28px; font-weight: 700; color: var(--dp-ink); }
body.dp .dp-stat-label { font-size: 12.5px; color: var(--dp-gray-500); font-weight: 600; }
body.dp .dp-stat-trend { font-size: 11.5px; font-weight: 700; }
body.dp .dp-stat-trend.is-up { color: var(--dp-success); }
body.dp .dp-stat-trend.is-flag { color: var(--dp-warning); }

/* Compact stats: on screens where a list is the real content, the cards are
   context, not the headline — this reclaims ~55px for the rows below. */
body.dp .dp-stat-grid.is-compact { gap: 12px; margin-bottom: 20px; }
body.dp .dp-stat-grid.is-compact .dp-stat-card { padding: 13px 15px; gap: 5px; }
body.dp .dp-stat-grid.is-compact .dp-stat-icon { width: 27px; height: 27px; }
body.dp .dp-stat-grid.is-compact .dp-stat-icon .dp-icon { width: 15px; height: 15px; }
body.dp .dp-stat-grid.is-compact .dp-stat-value { font-size: 22px; line-height: 1.1; }
body.dp .dp-stat-grid.is-compact .dp-stat-label { font-size: 11.5px; }
body.dp .dp-stat-grid.is-compact .dp-stat-trend { font-size: 10.5px; }

/* ---------------------------------------------------------------------- */
/* Resource Management: category rename grid                               */
/* ---------------------------------------------------------------------- */
body.dp .dp-cat-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; align-items: start; }

/*
 * Three columns: Load Bank Resources, Private Resources, and the two short
 * media cards stacked in the third. CSS columns were tried first and balanced
 * badly — the cards are very uneven, and the balancer packed them into two
 * columns and left the third blank. Explicit placement has no such ambiguity.
 *
 * align-items:start lets each column end where its content ends rather than
 * stretching to the tallest card.
 */
body.dp .dp-cat-columns {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px; align-items: start;
}
body.dp .dp-cat-stack { display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 1150px) { body.dp .dp-cat-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  body.dp .dp-cat-columns { grid-template-columns: 1fr; }
  /* Single column: the stack has nothing left to balance, so let its two
     cards flow as ordinary siblings. */
  body.dp .dp-cat-stack { display: contents; }
}
body.dp .dp-cat-row { display: grid; grid-template-columns: 1fr; gap: 5px; padding: 9px 0; }
body.dp .dp-cat-row + .dp-cat-row { border-top: 1px solid var(--dp-gray-100); }
body.dp .dp-cat-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; cursor: pointer; }

/* Parent vs sub-category. Children are indented and hung off a connector, the
   same shape used in the sidebar and on the dashboard trees. */
body.dp .dp-cat-row.is-child { padding-left: 16px; position: relative; }
body.dp .dp-cat-row.is-child::before {
  content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 1px; background: var(--dp-gray-200);
}
body.dp .dp-cat-row.is-child:last-child::before { bottom: 50%; }
body.dp .dp-cat-row.is-child::after {
  content: ""; position: absolute; left: 5px; top: 50%; width: 7px; height: 1px; background: var(--dp-gray-200);
}
body.dp .dp-cat-kind {
  display: inline-block; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--dp-white); background: var(--dp-ink); border-radius: 3px; padding: 1px 5px; margin-right: 5px;
  font-family: var(--dp-font-body); vertical-align: 1px;
}
body.dp .dp-cat-kind.is-sub { background: var(--dp-gray-400); }
/* The slug is the identity staff must not confuse with the editable name. */
body.dp .dp-cat-slug { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--dp-gray-500); word-break: break-all; }
body.dp .dp-cat-count { font-size: 11px; color: var(--dp-gray-500); white-space: nowrap; flex-shrink: 0; }
body.dp .dp-cat-input { display: flex; align-items: center; gap: 8px; }
body.dp .dp-cat-input .dp-input { flex: 1; min-width: 0; }
body.dp .dp-cat-renamed {
  flex-shrink: 0; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--dp-red); background: var(--dp-danger-bg); padding: 3px 7px; border-radius: var(--dp-radius-pill);
}

/* ---------------------------------------------------------------------- */
/* Resource Management: menu reorder lists                                 */
/* The only place the menus can be reordered — the live sidebars are not   */
/* draggable, so a stray drag can never rearrange navigation mid-task.     */
/* ---------------------------------------------------------------------- */
body.dp .dp-nav-sort { display: flex; flex-direction: column; gap: 6px; }
body.dp .dp-nav-sort-item {
  padding: 8px 10px;
  background: var(--dp-white); border: 1px solid var(--dp-gray-200); border-radius: var(--dp-radius-md);
  font-size: 13.5px; font-weight: 600; color: var(--dp-ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}
body.dp .dp-nav-sort-row { display: flex; align-items: center; gap: 8px; }

/* Sub-items are nested rows under their parent: same grip, same arrows, same
   rename field, indented and hung off a connector so the level is obvious. */
body.dp .dp-nav-sort-subs { margin: 8px 0 2px 22px; position: relative; }
body.dp .dp-nav-sort-subs::before {
  content: ""; position: absolute; left: -11px; top: 0; bottom: 10px; width: 1px; background: var(--dp-gray-200);
}
body.dp .dp-nav-sort.is-sub { gap: 4px; }
body.dp .dp-nav-sort-item.is-child {
  background: var(--dp-gray-50); padding: 5px 8px; position: relative;
}
body.dp .dp-nav-sort-item.is-child::before {
  content: ""; position: absolute; left: -11px; top: 50%; width: 11px; height: 1px; background: var(--dp-gray-200);
}
body.dp .dp-nav-sort-item.is-child .dp-input { background: var(--dp-white); font-size: 12.5px; padding: 5px 9px; }
body.dp .dp-nav-sort-item.is-child .dp-nav-sort-move { width: 20px; height: 20px; }
body.dp .dp-nav-sort-item.is-child .dp-nav-sort-pos { font-size: 10.5px; }
body.dp .dp-nav-sort-item:hover { border-color: var(--dp-gray-400); }
body.dp .dp-nav-sort-item.is-dragging { opacity: .4; }

/* A switched-off entry stays listed so it can be switched back on; it is
   dimmed rather than removed, and its name is struck through. */
body.dp .dp-nav-sort-item.is-hidden { background: var(--dp-gray-50); border-style: dashed; }
body.dp .dp-nav-sort-item.is-hidden .dp-input { color: var(--dp-gray-500); text-decoration: line-through; }
body.dp .dp-nav-sort-item.is-hidden > .dp-nav-sort-row > .dp-icon { opacity: .4; }

/* Visibility switch. */
/* Colleague access dialog: one row per portal section. */
body.dp .dp-access-list { display: flex; flex-direction: column; gap: 2px; }
body.dp .dp-access-list .dp-checkbox-row {
  padding: 9px 11px; border: 1px solid var(--dp-gray-200); border-radius: var(--dp-radius-md);
  background: var(--dp-white); cursor: pointer; font-size: 13.5px;
}
body.dp .dp-access-list .dp-checkbox-row:hover { border-color: var(--dp-gray-400); background: var(--dp-gray-50); }
body.dp .dp-access-list .dp-checkbox-row:focus-within { border-color: var(--dp-red); }

body.dp .dp-nav-vis { display: inline-flex; align-items: center; flex-shrink: 0; cursor: pointer; }
body.dp .dp-nav-vis input { position: absolute; opacity: 0; width: 0; height: 0; }
body.dp .dp-nav-vis-track {
  width: 28px; height: 16px; border-radius: var(--dp-radius-pill); background: var(--dp-gray-300);
  display: block; position: relative; transition: background-color .15s ease;
}
body.dp .dp-nav-vis-knob {
  position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--dp-white); transition: transform .15s ease; box-shadow: var(--dp-shadow-sm);
}
body.dp .dp-nav-vis input:checked + .dp-nav-vis-track { background: var(--dp-success, #1f9d55); }
body.dp .dp-nav-vis input:checked + .dp-nav-vis-track .dp-nav-vis-knob { transform: translateX(12px); }
body.dp .dp-nav-vis input:focus-visible + .dp-nav-vis-track { outline: 2px solid var(--dp-red); outline-offset: 2px; }
body.dp .dp-nav-sort.is-over { outline: 1px dashed var(--dp-gray-400); outline-offset: 4px; border-radius: var(--dp-radius-md); }

/* The grip is the drag handle — the row holds a text field, so the row
   itself must stay selectable. */
body.dp .dp-nav-sort-grip {
  display: grid; grid-template-columns: repeat(2, 3px); gap: 3px;
  justify-content: center; align-content: center; width: 12px; flex-shrink: 0;
  cursor: grab; padding: 4px 2px;
}
body.dp .dp-nav-sort-grip:active { cursor: grabbing; }
body.dp .dp-nav-sort-grip span { width: 3px; height: 3px; border-radius: 50%; background: var(--dp-gray-400); display: block; }
body.dp .dp-nav-sort-item .dp-icon { color: var(--dp-gray-500); flex-shrink: 0; }
body.dp .dp-nav-sort-name { flex: 1; min-width: 0; }
body.dp .dp-nav-sort-pos { font-size: 11px; color: var(--dp-gray-500); font-weight: 700; flex-shrink: 0; }

/* Keyboard equivalent, so reordering is not mouse-only. */
body.dp .dp-nav-sort-move {
  width: 22px; height: 22px; padding: 0; flex-shrink: 0; line-height: 0; cursor: pointer;
  background: none; border: 1px solid var(--dp-gray-200); border-radius: var(--dp-radius-sm); color: var(--dp-gray-500);
}
body.dp .dp-nav-sort-move:hover:not(:disabled) { background: var(--dp-gray-50); color: var(--dp-ink); border-color: var(--dp-gray-400); }
body.dp .dp-nav-sort-move:disabled { opacity: .3; cursor: default; }
body.dp .dp-nav-sort-move:focus-visible { outline: 2px solid var(--dp-red); outline-offset: 1px; }

/* ---------------------------------------------------------------------- */
/* Parent / child content trees (Dealer Management)                        */
/* Columns, not stacked rows: three full-width rows left a tall gap on a   */
/* wide screen and pushed the last section below the fold.                 */
/* ---------------------------------------------------------------------- */
body.dp .dp-tree-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; align-items: start; margin-bottom: 8px; }

body.dp .dp-tree { background: var(--dp-white); border: 1px solid var(--dp-gray-200); border-radius: var(--dp-radius-lg); overflow: hidden; }
/* The accent carries the tier, as elsewhere — no "Tier 1 / Tier 2" wording. */
body.dp .dp-tree.tier-1 { border-top: 3px solid var(--dp-ink); }
body.dp .dp-tree.tier-2 { border-top: 3px solid var(--dp-red); }

body.dp .dp-tree-head { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--dp-gray-100); }
body.dp .dp-tree-icon {
  width: 32px; height: 32px; border-radius: var(--dp-radius-md); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; background: var(--dp-ink); color: var(--dp-white);
}
body.dp .dp-tree.tier-2 .dp-tree-icon { background: var(--dp-red); }
body.dp .dp-tree-head-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
body.dp .dp-tree-title { font-family: var(--dp-font-display); font-size: 13.5px; font-weight: 700; color: var(--dp-ink); line-height: 1.3; }
body.dp a.dp-tree-title:hover { color: var(--dp-red); }
body.dp .dp-tree-note { font-size: 11px; color: var(--dp-gray-500); line-height: 1.35; }
body.dp .dp-tree-count {
  flex-shrink: 0; min-width: 22px; text-align: center; font-size: 11px; font-weight: 700;
  color: var(--dp-gray-600); background: var(--dp-gray-100); border-radius: var(--dp-radius-pill); padding: 2px 7px;
}

/* The connector rule is the parent/child signal: children hang off it. */
body.dp .dp-tree-children { padding: 8px 14px 12px 26px; position: relative; }
body.dp .dp-tree-children::before {
  content: ""; position: absolute; left: 16px; top: 4px; bottom: 16px; width: 1px; background: var(--dp-gray-200);
}
body.dp .dp-tree-child { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: var(--dp-radius-md); position: relative; }
body.dp .dp-tree-child::before {
  content: ""; position: absolute; left: -10px; top: 50%; width: 10px; height: 1px; background: var(--dp-gray-200);
}
body.dp .dp-tree-child:hover { background: var(--dp-gray-50); }
body.dp .dp-tree-child-icon { color: var(--dp-gray-500); flex-shrink: 0; line-height: 0; }
body.dp .dp-tree-child:hover .dp-tree-child-icon { color: var(--dp-red); }
body.dp .dp-tree-child-text { display: flex; flex-direction: column; min-width: 0; }
body.dp .dp-tree-child-title { font-size: 13px; font-weight: 700; color: var(--dp-ink); line-height: 1.35; }
body.dp .dp-tree-child-meta { font-size: 11px; color: var(--dp-gray-500); line-height: 1.35; }

body.dp .dp-quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin: 0 0 32px; }

/* Overflow link for a capped tile row. Sits above the grid and is pulled up
   beside the section heading, so the row itself stays exactly four across. */
body.dp .dp-section-more { display: flex; justify-content: flex-end; margin: -28px 0 10px; }
body.dp .dp-section-more a { font-size: 12px; font-weight: 700; color: var(--dp-red); }
body.dp .dp-section-more a:hover { text-decoration: underline; }
@media (max-width: 720px) {
  body.dp .dp-section-more { margin-top: 0; justify-content: flex-start; }
}

body.dp .dp-quick-action {
  background: var(--dp-white); border: 1px solid var(--dp-gray-200); border-radius: var(--dp-radius-lg);
  padding: 20px; display: flex; align-items: center; gap: 14px; transition: border-color .15s ease, box-shadow .15s ease;
}
body.dp .dp-quick-action:hover { border-color: var(--dp-ink); box-shadow: var(--dp-shadow-sm); }
body.dp .dp-quick-action-icon {
  width: 40px; height: 40px; border-radius: var(--dp-radius-md); background: var(--dp-ink); color: var(--dp-white);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
body.dp .dp-quick-action-title { font-weight: 700; font-size: 13.5px; color: var(--dp-ink); }
body.dp .dp-quick-action-desc { font-size: 12px; color: var(--dp-gray-500); margin-top: 2px; }

/* Dealer-specific (Tier 2) cards read warmer so the two tiers are
   distinguishable at a glance without reading the headings. */
body.dp .dp-quick-action.is-private { border-color: #ead9ab; background: #fffdf6; }
body.dp .dp-quick-action.is-private:hover { border-color: #9a7212; }
body.dp .dp-quick-action.is-private .dp-quick-action-icon { background: #7d5d0f; }

/* ---------------------------------------------------------------------- */
/* Section headers. One rhythm for every section: 32px above the heading,  */
/* 14px between the heading and its cards. The accent rule sits in the     */
/* gutter so the heading text stays flush with the cards below it.         */
/* ---------------------------------------------------------------------- */
body.dp .dp-tier-head {
  position: relative; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 0; margin: 32px 0 14px;
}
body.dp .dp-tier-head::before {
  content: ""; position: absolute; left: -14px; top: 1px; bottom: 1px;
  width: 4px; border-radius: 2px; background: var(--dp-gray-300);
}
body.dp .dp-tier-head.is-tier-1::before { background: #1f6f47; }
body.dp .dp-tier-head.is-tier-2::before { background: #9a7212; }
body.dp .dp-tier-title {
  font-family: var(--dp-font-display); font-size: 16px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .01em; color: var(--dp-ink); margin: 0;
}
body.dp .dp-tier-note { font-size: 12.5px; color: var(--dp-gray-500); margin-left: auto; }

@media (max-width: 560px) {
  body.dp .dp-tier-note { margin-left: 0; width: 100%; }
}

/* Divider that separates the review queue from the content-management
   sections on the staff dashboard. */
body.dp .dp-section-rule {
  display: flex; align-items: center; gap: 14px; margin: 36px 0 0;
  font-family: var(--dp-font-display); font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--dp-gray-500);
}
body.dp .dp-section-rule::after {
  content: ""; flex: 1; height: 1px; background: var(--dp-gray-200);
}
/* The rule already announces the group, so the heading under it sits closer. */
body.dp .dp-section-rule + .dp-tier-head { margin-top: 18px; }

/* Two-column dashboard layout */
body.dp .dp-dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }

body.dp .dp-activity-item { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--dp-gray-100); }
body.dp .dp-activity-item:last-child { border-bottom: 0; }
body.dp .dp-activity-icon {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--dp-info-bg); color: var(--dp-info);
}
body.dp .dp-activity-icon.is-private { background: var(--dp-red-tint); color: var(--dp-red); }
body.dp .dp-activity-label { font-size: 13px; color: var(--dp-ink); font-weight: 600; line-height: 1.4; }
body.dp .dp-activity-meta { font-size: 11.5px; color: var(--dp-gray-500); margin-top: 3px; }

/* ---------------------------------------------------------------------- */
/* Filter bar                                                              */
/* ---------------------------------------------------------------------- */

body.dp .dp-filter-bar {
  background: var(--dp-white); border: 1px solid var(--dp-gray-200); border-radius: var(--dp-radius-lg);
  padding: 16px 18px; display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
body.dp .dp-filter-item { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
body.dp .dp-filter-item.is-search { flex: 1 1 240px; min-width: 220px; }
body.dp .dp-filter-item label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--dp-gray-500); }
body.dp .dp-search-input { position: relative; }
body.dp .dp-search-input svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--dp-gray-400); pointer-events: none; }
body.dp .dp-search-input input { padding-left: 36px; }
body.dp .dp-filter-clear { font-size: 12.5px; font-weight: 700; color: var(--dp-red); background: none; border: none; cursor: pointer; padding: 11px 4px; }
body.dp .dp-filter-clear:hover { text-decoration: underline; }
body.dp .dp-filter-count { font-size: 12.5px; color: var(--dp-gray-500); margin-bottom: 14px; }
body.dp .dp-filter-count strong { color: var(--dp-ink); }

/* ---------------------------------------------------------------------- */
/* Tables                                                                   */
/* ---------------------------------------------------------------------- */

body.dp .dp-table-card { background: var(--dp-white); border: 1px solid var(--dp-gray-200); border-radius: var(--dp-radius-lg); overflow: hidden; }
body.dp .dp-table-scroll { overflow-x: auto; }
body.dp table.dp-table { width: 100%; border-collapse: collapse; min-width: 760px; }
body.dp .dp-table th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--dp-gray-500); background: var(--dp-gray-50); padding: 13px 18px; border-bottom: 1px solid var(--dp-gray-200); white-space: nowrap;
}
body.dp .dp-table th.is-sortable { cursor: pointer; user-select: none; }
body.dp .dp-table th.is-sortable:hover { color: var(--dp-ink); }
body.dp .dp-table th .dp-sort-icon { display: inline-block; margin-left: 4px; opacity: .5; }
body.dp .dp-table th.is-sorted .dp-sort-icon { opacity: 1; color: var(--dp-red); }
body.dp .dp-table td { padding: 15px 18px; border-bottom: 1px solid var(--dp-gray-100); font-size: 13.5px; color: var(--dp-ink-soft); vertical-align: middle; }
body.dp .dp-table tbody tr:last-child td { border-bottom: 0; }
body.dp .dp-table tbody tr { transition: background-color .12s ease; }
body.dp .dp-table tbody tr:hover { background: var(--dp-gray-50); }
body.dp .dp-table .dp-cell-primary { font-weight: 700; color: var(--dp-ink); }
body.dp .dp-table .dp-cell-primary a:hover { color: var(--dp-red); }
body.dp .dp-table .dp-cell-meta { color: var(--dp-gray-500); font-size: 12px; margin-top: 2px; }
body.dp .dp-table .dp-cell-actions { text-align: right; white-space: nowrap; }
body.dp .dp-table .dp-file-icon {
  width: 32px; height: 32px; border-radius: var(--dp-radius-sm); background: var(--dp-gray-100); color: var(--dp-gray-600);
  display: flex; align-items: center; justify-content: center; font-family: var(--dp-font-display); font-size: 9.5px; font-weight: 700; flex-shrink: 0;
}
body.dp .dp-cell-flex { display: flex; align-items: center; gap: 12px; }

/* ---------------------------------------------------------------------- */
/* Media card grid (Products & Training, Video Library) — a clean          */
/* browse/consume experience, deliberately lighter than the data tables    */
/* used for My Resources / admin management.                              */
/* ---------------------------------------------------------------------- */

body.dp .dp-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }

body.dp .dp-media-card {
  background: var(--dp-white); border: 1px solid var(--dp-gray-200); border-radius: var(--dp-radius-lg);
  overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
/* Keyed to the card, not to a.dp-media-card: the product and video cards are
   <div>s holding several links, so an anchor-only selector never matched. */
body.dp .dp-media-card:hover { border-color: var(--dp-ink); box-shadow: var(--dp-shadow-md); transform: translateY(-2px); }

body.dp .dp-media-card-visual {
  aspect-ratio: 4 / 3; background: var(--dp-gray-100); color: var(--dp-white);
  display: flex; align-items: center; justify-content: center; position: relative; flex-shrink: 0; overflow: hidden;
}
body.dp .dp-media-card-visual img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
body.dp .dp-media-card:hover .dp-media-card-visual img { transform: scale(1.04); }
body.dp .dp-media-card-visual .dp-file-icon { width: 44px; height: 44px; font-size: 11px; background: var(--dp-ink); color: var(--dp-white); }
body.dp .dp-media-format-chip {
  position: absolute; left: 10px; top: 10px; background: rgba(20,20,20,0.72); color: var(--dp-white);
  font-family: var(--dp-font-display); font-size: 10px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 3px;
}

body.dp .dp-media-card-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
body.dp .dp-media-card-title { font-weight: 700; font-size: 14px; color: var(--dp-ink); line-height: 1.4; }
body.dp a.dp-media-card-title:hover { color: var(--dp-red); }
body.dp .dp-media-card-meta { font-size: 12px; color: var(--dp-gray-500); }
body.dp .dp-media-card-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
body.dp .dp-media-card-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Video-specific: image thumbnail (or dark gradient fallback), darkened for
   legibility, with a centered play button and duration chip on top. */
body.dp .dp-video-thumb {
  aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1b1b1b, #303030) center / cover;
  position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden;
}
body.dp .dp-video-thumb::before {
  content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,10,10,0.15), rgba(10,10,10,0.55));
}
body.dp .dp-video-thumb > * { position: relative; z-index: 1; }
body.dp .dp-play-btn {
  width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,0.14); border: 2px solid rgba(255,255,255,0.65);
  display: flex; align-items: center; justify-content: center; transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
body.dp .dp-play-btn svg { width: 20px; height: 20px; margin-left: 3px; }
body.dp .dp-media-card:hover .dp-play-btn { background: var(--dp-red); border-color: var(--dp-red); transform: scale(1.08); }
body.dp .dp-video-duration {
  position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,0.65); color: var(--dp-white);
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 3px; letter-spacing: .02em;
}

/* ---------------------------------------------------------------------- */
/* Empty / loading / no-results states                                     */
/* ---------------------------------------------------------------------- */

body.dp .dp-empty-state { padding: 64px 24px; text-align: center; }
body.dp .dp-empty-icon {
  width: 56px; height: 56px; border-radius: 50%; background: var(--dp-gray-50); color: var(--dp-gray-400);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
body.dp .dp-empty-title { font-weight: 700; color: var(--dp-ink); margin-bottom: 6px; }
body.dp .dp-empty-desc { font-size: 13px; color: var(--dp-gray-500); max-width: 360px; margin: 0 auto 18px; }

body.dp .dp-skeleton-row td { padding: 15px 18px; }
body.dp .dp-skeleton { height: 14px; border-radius: 3px; background: linear-gradient(90deg, var(--dp-gray-100) 25%, var(--dp-gray-200) 37%, var(--dp-gray-100) 63%); background-size: 400% 100%; animation: dp-shimmer 1.4s ease infinite; }
@keyframes dp-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------------------------------------------------------------- */
/* Pagination                                                               */
/* ---------------------------------------------------------------------- */

body.dp .dp-pagination { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-top: 1px solid var(--dp-gray-200); flex-wrap: wrap; gap: 10px; }
body.dp .dp-pagination-summary { font-size: 12.5px; color: var(--dp-gray-500); }
body.dp .dp-pagination-controls { display: flex; align-items: center; gap: 6px; }
body.dp .dp-page-btn {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--dp-radius-sm); border: 1px solid var(--dp-gray-200);
  background: var(--dp-white); color: var(--dp-gray-600); font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
body.dp .dp-page-btn:hover:not(:disabled) { border-color: var(--dp-ink); color: var(--dp-ink); }
body.dp .dp-page-btn.is-active { background: var(--dp-ink); border-color: var(--dp-ink); color: var(--dp-white); }
body.dp .dp-page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------------------------------------------------------------------- */
/* File upload                                                             */
/* ---------------------------------------------------------------------- */

body.dp .dp-dropzone {
  border: 1.5px dashed var(--dp-gray-300); border-radius: var(--dp-radius-lg); background: var(--dp-gray-50);
  padding: 34px 20px; text-align: center; transition: border-color .15s ease, background-color .15s ease; cursor: pointer;
}
body.dp .dp-dropzone:hover, body.dp .dp-dropzone.is-dragover { border-color: var(--dp-red); background: var(--dp-red-tint); }
body.dp .dp-dropzone-icon { width: 42px; height: 42px; border-radius: 50%; background: var(--dp-white); border: 1px solid var(--dp-gray-200); color: var(--dp-gray-500); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
body.dp .dp-dropzone-title { font-weight: 700; font-size: 14px; color: var(--dp-ink); margin-bottom: 4px; }
body.dp .dp-dropzone-title button { color: var(--dp-red); background: none; border: none; font-weight: 700; text-decoration: underline; cursor: pointer; font-size: inherit; padding: 0; }
body.dp .dp-dropzone-meta { font-size: 12px; color: var(--dp-gray-500); }
body.dp .dp-dropzone input[type=file] { display: none; }

body.dp .dp-file-preview {
  display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--dp-gray-200); border-radius: var(--dp-radius-md); background: var(--dp-white); margin-top: 14px;
}
body.dp .dp-file-preview-name { font-weight: 700; font-size: 13px; color: var(--dp-ink); }
body.dp .dp-file-preview-meta { font-size: 11.5px; color: var(--dp-gray-500); margin-top: 2px; }
body.dp .dp-file-preview-remove { margin-left: auto; background: none; border: none; color: var(--dp-gray-400); cursor: pointer; padding: 6px; border-radius: var(--dp-radius-sm); }
body.dp .dp-file-preview-remove:hover { background: var(--dp-danger-bg); color: var(--dp-danger); }
body.dp .dp-progress-track { height: 5px; border-radius: 3px; background: var(--dp-gray-100); margin-top: 10px; overflow: hidden; }
body.dp .dp-progress-fill { height: 100%; width: 0%; background: var(--dp-red); transition: width .2s ease; border-radius: 3px; }

body.dp .dp-visibility-note {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--dp-radius-md); background: var(--dp-red-tint); border: 1px solid rgba(237,27,37,0.18); font-size: 12.5px; color: #7A0D12; line-height: 1.6; margin-bottom: 22px;
}

/* ---------------------------------------------------------------------- */
/* Modal / confirmation / toast (self-contained, no external JS library)   */
/* ---------------------------------------------------------------------- */

body.dp .modal-backdrop { position: fixed; inset: 0; background: rgba(10,10,10,0.5); z-index: 1049; opacity: 0; transition: opacity .15s ease; }
body.dp .modal-backdrop.show { opacity: 1; }
body.dp .modal { display: none; position: fixed; inset: 0; z-index: 1050; padding: 20px; overflow-y: auto; }
body.dp .modal.show { display: flex; align-items: center; justify-content: center; }
body.dp .modal-dialog { width: 100%; max-width: 440px; margin: auto; }
body.dp .modal-content { border-radius: var(--dp-radius-lg); border: none; box-shadow: var(--dp-shadow-lg); font-family: var(--dp-font-body); background: var(--dp-white); }
body.dp .modal-header { border-bottom: 1px solid var(--dp-gray-200); padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; }
body.dp .modal-header .modal-title { font-family: var(--dp-font-display); font-size: 16px; font-weight: 700; color: var(--dp-ink); text-transform: none; }
body.dp .modal-body { padding: 22px; font-size: 13.5px; color: var(--dp-ink-soft); }
body.dp .modal-footer { border-top: 1px solid var(--dp-gray-200); padding: 16px 22px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
body.dp .modal-icon-danger {
  width: 42px; height: 42px; border-radius: 50%; background: var(--dp-danger-bg); color: var(--dp-danger);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}

/* ---------------------------------------------------------------------- */
/* Document & video viewer popup                                           */
/* Wide dialog, flush body: the file itself is the content, so the frame   */
/* gets the room rather than the chrome around it.                         */
/* ---------------------------------------------------------------------- */
body.dp .dp-viewer-dialog { max-width: min(1120px, 94vw); }
body.dp .dp-viewer-modal .modal-content { max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
body.dp .dp-viewer-modal .modal-header { flex-shrink: 0; gap: 14px; }

body.dp .dp-viewer-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
body.dp .dp-viewer-headings { min-width: 0; }
body.dp .dp-viewer-heading .modal-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.dp .dp-viewer-meta { font-size: 11.5px; color: var(--dp-gray-500); margin-top: 2px; }

body.dp .dp-viewer-close {
  background: none; border: none; padding: 6px; border-radius: var(--dp-radius-sm);
  color: var(--dp-gray-500); cursor: pointer; flex-shrink: 0; line-height: 0;
}
body.dp .dp-viewer-close:hover { background: var(--dp-gray-100); color: var(--dp-ink); }

body.dp .dp-viewer-body { padding: 0; background: var(--dp-gray-200); flex: 1; min-height: 0; overflow: auto; }
body.dp .dp-viewer-modal.is-media .dp-viewer-body { background: #000; }
body.dp .dp-viewer-frame { width: 100%; height: min(74vh, 860px); border: 0; display: block; background: var(--dp-gray-200); }
body.dp .dp-viewer-modal.is-media .dp-viewer-frame { background: #000; }
body.dp .dp-viewer-video { width: 100%; max-height: min(74vh, 860px); display: block; background: #000; }
body.dp .dp-viewer-image { display: flex; align-items: center; justify-content: center; padding: 18px; }
body.dp .dp-viewer-image img { max-width: 100%; max-height: min(70vh, 800px); display: block; border-radius: var(--dp-radius-sm); }

/* Office formats and empty records: a card that says why, not a blank frame. */
body.dp .dp-viewer-fallback {
  background: var(--dp-white); display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 8px; padding: 48px 32px; min-height: 320px;
}
body.dp .dp-viewer-fallback .dp-file-icon.is-lg {
  width: 68px; height: 68px; font-size: 13px; background: var(--dp-ink); color: var(--dp-white); margin-bottom: 4px;
}
body.dp .dp-viewer-fallback-title { font-weight: 700; font-size: 14.5px; color: var(--dp-ink); word-break: break-all; }
body.dp .dp-viewer-fallback-meta { font-size: 12px; color: var(--dp-gray-500); }
body.dp .dp-viewer-fallback-head { font-weight: 700; font-size: 13.5px; color: var(--dp-ink); margin-top: 8px; }
body.dp .dp-viewer-fallback-help { max-width: 400px; margin: 0; font-size: 13px; line-height: 1.6; color: var(--dp-gray-600); }

body.dp .dp-viewer-footer { flex-shrink: 0; }
body.dp .dp-viewer-footer .dp-btn-ghost { margin-right: auto; }

@media (max-width: 720px) {
  body.dp .dp-viewer-dialog { max-width: 100%; }
  body.dp .dp-viewer-frame { height: 62vh; }
  body.dp .dp-viewer-footer { flex-wrap: wrap; }
  body.dp .dp-viewer-footer .dp-btn-ghost { margin-right: 0; }
}

body.dp .dp-toast-container { position: fixed; right: 20px; bottom: 20px; z-index: 1080; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 40px); }
body.dp .dp-toast {
  border-radius: var(--dp-radius-md); border: 1px solid var(--dp-gray-200); box-shadow: var(--dp-shadow-md);
  min-width: 280px; background: var(--dp-white); opacity: 0; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease;
}
body.dp .dp-toast.show { opacity: 1; transform: translateY(0); }
body.dp .dp-toast-body { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--dp-ink); padding: 13px 14px; }
body.dp .dp-toast-icon { width: 22px; height: 22px; border-radius: 50%; background: var(--dp-success-bg); color: var(--dp-success); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---------------------------------------------------------------------- */
/* Details drawer                                                          */
/* ---------------------------------------------------------------------- */

body.dp .dp-detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
body.dp .dp-detail-preview {
  aspect-ratio: 4 / 3; background: var(--dp-ink); border-radius: var(--dp-radius-lg); display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: var(--dp-white); gap: 10px; margin-bottom: 20px;
}
body.dp .dp-detail-preview .dp-file-icon { width: 52px; height: 52px; font-size: 12px; background: rgba(255,255,255,0.12); color: var(--dp-white); }
body.dp .dp-detail-preview-meta { font-size: 12px; color: var(--dp-gray-400); }

/* ---------------------------------------------------------------------- */
/* Document preview                                                        */
/* A PDF renders in the browser's own viewer; formats with no native       */
/* preview get a light card explaining why and offering the download.      */
/* ---------------------------------------------------------------------- */
body.dp .dp-detail-preview.is-embed {
  aspect-ratio: auto; height: clamp(420px, 70vh, 820px);
  padding: 0; overflow: hidden; background: var(--dp-gray-200); margin-bottom: 8px;
}
body.dp .dp-pdf-frame { width: 100%; height: 100%; border: 0; display: block; background: var(--dp-gray-200); }

body.dp .dp-preview-note { font-size: 12.5px; color: var(--dp-gray-500); margin-bottom: 20px; }
body.dp .dp-preview-note a { color: var(--dp-red); font-weight: 700; }
body.dp .dp-preview-note a:hover { text-decoration: underline; }

body.dp .dp-detail-preview.is-fallback {
  background: var(--dp-gray-50); border: 1px solid var(--dp-gray-200);
  color: var(--dp-ink); text-align: center; padding: 32px;
}
body.dp .dp-detail-preview.is-fallback .dp-file-icon.is-lg {
  width: 68px; height: 68px; font-size: 13px;
  background: var(--dp-ink); color: var(--dp-white);
}
body.dp .dp-detail-preview-title { font-weight: 700; font-size: 14.5px; color: var(--dp-ink); word-break: break-all; }
body.dp .dp-detail-preview.is-fallback .dp-detail-preview-meta { color: var(--dp-gray-500); }
body.dp .dp-detail-preview-help {
  max-width: 380px; margin: 4px 0 6px; font-size: 13px; line-height: 1.6; color: var(--dp-gray-600);
}

@media (max-width: 900px) {
  body.dp .dp-detail-preview.is-embed { height: 60vh; }
}

/* ---------------------------------------------------------------------- */
/* Breadcrumb page-level (auth) + misc                                     */
/* ---------------------------------------------------------------------- */

body.dp hr.dp-divider { border: none; border-top: 1px solid var(--dp-gray-200); margin: 24px 0; }

/* ---------------------------------------------------------------------- */
/* Responsive                                                               */
/* ---------------------------------------------------------------------- */

@media (max-width: 1240px) {
  body.dp .dp-stat-grid { grid-template-columns: repeat(2, 1fr); }
  body.dp .dp-dashboard-grid { grid-template-columns: 1fr; }
  body.dp .dp-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  body.dp .dp-sidebar { transform: translateX(-100%); box-shadow: var(--dp-shadow-lg); }
  body.dp.dp-sidebar-open .dp-sidebar { transform: translateX(0); }
  body.dp .dp-main { margin-left: 0; }
  body.dp .dp-sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
  body.dp .dp-dealer-chip span { display: none; }
  /* Collapse to the avatar alone; the name still shows inside the panel. */
  body.dp .dp-user-menu-text, body.dp .dp-user-menu-caret { display: none; }
  body.dp .dp-user-menu-trigger { padding: 4px; gap: 0; }

  /*
   * Below this width the sidebar is already an off-canvas drawer opened by the
   * hamburger, so an icon rail makes no sense. Hide the toggle and unwind the
   * collapsed state, otherwise a choice made on a desktop would follow the
   * user to a phone and leave them with a drawer full of unlabelled icons.
   */
  body.dp .dp-sidebar-collapse { display: none; }
  body.dp.dp-sidebar-collapsed { --dp-sidebar-w: 264px; }
  body.dp.dp-sidebar-collapsed .dp-sidebar-head { flex-direction: row; padding: 0 10px 0 0; }
  body.dp.dp-sidebar-collapsed .dp-sidebar-brand { padding: 20px 22px; justify-content: flex-start; flex: 1; width: auto; }
  body.dp.dp-sidebar-collapsed .dp-sidebar-brand-text { display: block; }
  body.dp.dp-sidebar-collapsed .dp-nav-group { padding: 6px 14px; }
  body.dp.dp-sidebar-collapsed .dp-nav-link {
    font-size: 13.5px; gap: 11px; justify-content: flex-start; padding: 8px 11px;
    border-left: 3px solid transparent; border-right: none;
  }
  body.dp.dp-sidebar-collapsed .dp-nav-link.is-active { border-left-color: var(--dp-red); }
  body.dp.dp-sidebar-collapsed .dp-nav-subgroup { display: block; }
}

@media (max-width: 720px) {
  body.dp .dp-dealer-chip { display: none; }
}

@media (max-width: 720px) {
  body.dp .dp-content { padding: 20px 16px 48px; }
  body.dp .dp-topbar { padding: 0 16px; }
  body.dp .dp-stat-grid { grid-template-columns: 1fr; }
  body.dp .dp-field-row { grid-template-columns: 1fr; }
  body.dp .dp-page-header { flex-direction: column; }
  body.dp .dp-page-header-actions { width: 100%; }
  body.dp .dp-page-header-actions .dp-btn { flex: 1; }
  body.dp .dp-auth-header { padding: 16px 18px; }
  body.dp .dp-auth-main { padding: 32px 14px 50px; }
  body.dp .dp-card-pad { padding: 20px; }
  body.dp .dp-breadcrumbs { display: none; }
}

/* Mobile card-style table fallback */
@media (max-width: 640px) {
  body.dp .dp-table-scroll { overflow-x: visible; }
  body.dp table.dp-table.dp-table-stack, body.dp table.dp-table.dp-table-stack thead, body.dp table.dp-table.dp-table-stack tbody, body.dp table.dp-table.dp-table-stack tr, body.dp table.dp-table.dp-table-stack td { display: block; width: 100%; min-width: 0; }
  body.dp table.dp-table.dp-table-stack thead { display: none; }
  body.dp table.dp-table.dp-table-stack tr { border-bottom: 1px solid var(--dp-gray-200); padding: 14px 18px; }
  body.dp table.dp-table.dp-table-stack td { border-bottom: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  body.dp table.dp-table.dp-table-stack td::before { content: attr(data-label); font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--dp-gray-500); letter-spacing: .04em; }
  body.dp table.dp-table.dp-table-stack td.dp-cell-actions { justify-content: flex-end; }
  body.dp table.dp-table.dp-table-stack td.dp-cell-actions::before { display: none; }
}
