/* =========================================================
   NBDesigner / Cmsmart — Modern Admin Theme
   Derived from "Printcart Store WP Admin v3.0.1" template.
   Restyles the plugin's existing WP admin markup (no markup
   changes required). Loaded only on plugin admin pages.

   Strategy:
   - :root tokens replicate the template design system.
   - Native WP elements (.wrap, .button, .form-table,
     .wp-list-table, .postbox, .nav-tab, .notice) are mapped
     onto the template's component look.
   - Template component classes (.nbd-page-head, .nbd-card,
     .nbd-stat-card, .nbd-stats-grid, .nbd-pill, .btn*) are
     also provided for any refactored/new markup.
   ========================================================= */

/* ---------- DESIGN TOKENS ----------
   One source of truth. See docs/spec/ui-design-system.md for the rules that
   govern how these are used (CTA + note, stat-card + note + CTA, page-head
   subtitle, field notes, button states, colour accents). */
:root {
  /* ---- Brand primary: ONE blue, everything else aliases to it ----
     Historically the theme carried two blues — WP admin #2271b1 and the
     Printcart-template #2563eb — which read as "off" side by side. They now
     resolve to a single primary so buttons, tabs, inputs and links agree. */
  --nbd-primary:        #2563eb;
  --nbd-primary-hover:  #1d4ed8;
  --nbd-primary-soft:   #e6edfe;
  --nbd-primary-tint:   #f2f6fe;

  /* Legacy aliases (kept so existing rules/markup keep working) */
  --nbd-mb-primary:         var(--nbd-primary);
  --nbd-mb-primary-pressed: var(--nbd-primary-hover);
  --nbd-mb-primary-soft:    var(--nbd-primary-soft);
  --pc-brand:               var(--nbd-primary);
  --pc-brand-soft:          var(--nbd-primary-soft);
  --pc-brand-press:         var(--nbd-primary-hover);

  --pc-brand-2: #6366f1;
  --pc-brand-gradient: linear-gradient(135deg, #3b82f6, #6366f1);
  --pc-accent: #fbbf24;
  --pc-accent-2: #06b6d4;

  --nbd-mb-text: #1d2327;
  --nbd-mb-text-soft: #50575e;
  --nbd-mb-text-mute: #8c8f94;

  --nbd-mb-bg: #ffffff;
  --nbd-mb-bg-soft: #f6f7f7;
  --nbd-mb-bg-canvas: #f0f0f1;
  /* Canvas gets a barely-there cool wash so full pages don't read as flat grey. */
  --nbd-canvas-gradient: linear-gradient(180deg, #f4f7fc 0%, #f0f0f1 340px);

  --nbd-mb-border: #c3c4c7;
  --nbd-mb-border-light: #dcdcde;
  --nbd-mb-border-subtle: #f0f0f1;

  --nbd-color-success: #16a34a;
  --nbd-color-success-soft: #dcf5e6;
  --nbd-color-warning: #d97706;
  --nbd-color-warning-soft: #fdeecf;
  --nbd-color-error: #dc2626;
  --nbd-color-error-soft: #fbe0e0;
  --nbd-color-info: #2563eb;
  --nbd-color-info-soft: #e6edfe;

  --nbd-color-violet: #7c3aed;
  --nbd-color-violet-soft: #ede4fd;

  /* Very-soft near-white card tints (stat-card backgrounds) */
  --nbd-tint-info: #f2f6fe;
  --nbd-tint-success: #f2fbf6;
  --nbd-tint-warning: #fdf8ee;
  --nbd-tint-violet: #f8f5fe;

  /* ---- Typography scale (was hard-coded 11–24px everywhere) ---- */
  --nbd-text-xs:   11px;   /* pills, meta */
  --nbd-text-sm:   12px;   /* notes, captions, stat labels */
  --nbd-text-base: 13px;   /* body / controls — WP admin default */
  --nbd-text-md:   14px;   /* card titles, emphasised body */
  --nbd-text-lg:   18px;   /* section titles */
  --nbd-text-xl:   24px;   /* stat values, page numbers */
  --nbd-leading-tight:  1.2;
  --nbd-leading-normal: 1.5;
  --nbd-weight-normal:   400;
  --nbd-weight-medium:   500;
  --nbd-weight-semibold: 600;
  --nbd-weight-bold:     700;

  --nbd-space-1: 4px;
  --nbd-space-2: 8px;
  --nbd-space-3: 12px;
  --nbd-space-4: 16px;
  --nbd-space-5: 20px;   /* fills the 16→24 gap used raw in banners */
  --nbd-space-6: 24px;
  --nbd-space-8: 32px;
  --nbd-space-12: 48px;

  --nbd-radius-sm: 3px;
  --nbd-radius-md: 4px;
  --nbd-radius-lg: 6px;
  --nbd-radius-xl: 8px;
  --nbd-radius-full: 9999px;

  --nbd-shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --nbd-shadow-md: 0 2px 4px 0 rgba(0,0,0,0.08);
  --nbd-shadow-lg: 0 4px 12px 0 rgba(0,0,0,0.08);
  --nbd-shadow-xl: 0 8px 24px 0 rgba(0,0,0,0.16);
  --nbd-shadow-dialog: 0 18px 48px rgba(15, 23, 42, 0.22);
  --nbd-overlay-scrim: rgba(15, 23, 42, 0.48);

  /* One focus treatment for the whole UI (inputs + buttons + links). */
  --nbd-ring: 0 0 0 3px rgba(37,99,235,0.35);

  --nbd-duration-fast: 120ms;
  --nbd-duration-normal: 220ms;
}

/* =========================================================
   SCOPE — everything below is scoped to .nbd-modern-ui,
   a class added to <body> only on plugin admin pages.
   ========================================================= */

/* ---------- Dialogs + Toasts ----------
   Replaces browser alert/confirm popups on plugin admin screens. */
.nbd-admin-toasts {
  position: fixed;
  z-index: 100000;
  top: 42px;
  right: var(--nbd-space-5);
  display: grid;
  gap: var(--nbd-space-2);
  width: min(380px, calc(100vw - 40px));
  pointer-events: none;
}
.nbd-admin-toast {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 28px;
  gap: var(--nbd-space-3);
  align-items: flex-start;
  padding: var(--nbd-space-3);
  border: 1px solid var(--nbd-mb-border-light);
  border-left: 4px solid var(--nbd-color-info);
  border-radius: var(--nbd-radius-xl);
  background: var(--nbd-mb-bg);
  color: var(--nbd-mb-text);
  box-shadow: var(--nbd-shadow-lg);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--nbd-duration-fast) ease, transform var(--nbd-duration-fast) ease;
  pointer-events: auto;
}
.nbd-admin-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.nbd-admin-toast.is-success { border-left-color: var(--nbd-color-success); }
.nbd-admin-toast.is-warning { border-left-color: var(--nbd-color-warning); }
.nbd-admin-toast.is-error { border-left-color: var(--nbd-color-error); }
.nbd-admin-toast-icon {
  width: 20px;
  height: 20px;
  color: var(--nbd-color-info);
  font-size: 20px;
  line-height: 20px;
}
.nbd-admin-toast.is-success .nbd-admin-toast-icon { color: var(--nbd-color-success); }
.nbd-admin-toast.is-warning .nbd-admin-toast-icon { color: var(--nbd-color-warning); }
.nbd-admin-toast.is-error .nbd-admin-toast-icon { color: var(--nbd-color-error); }
.nbd-admin-toast-title {
  display: block;
  margin-bottom: 2px;
  font-size: var(--nbd-text-base);
  line-height: var(--nbd-leading-tight);
}
.nbd-admin-toast-message {
  color: var(--nbd-mb-text-soft);
  font-size: var(--nbd-text-base);
  line-height: var(--nbd-leading-normal);
  overflow-wrap: anywhere;
}
.nbd-admin-toast-close,
.nbd-admin-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--nbd-radius-md);
  background: transparent;
  color: var(--nbd-mb-text-soft);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.nbd-admin-toast-close:hover,
.nbd-admin-toast-close:focus,
.nbd-admin-dialog-close:hover,
.nbd-admin-dialog-close:focus {
  background: var(--nbd-mb-bg-soft);
  color: var(--nbd-mb-text);
  outline: none;
  box-shadow: var(--nbd-ring);
}
.nbd-admin-dialog-overlay {
  position: fixed;
  z-index: 100001;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh var(--nbd-space-5) var(--nbd-space-5);
  background: var(--nbd-overlay-scrim);
  opacity: 0;
  transition: opacity var(--nbd-duration-fast) ease;
}
.nbd-admin-dialog-overlay.is-visible {
  opacity: 1;
}
.nbd-admin-dialog {
  width: min(520px, 100%);
  max-height: calc(100vh - 96px);
  overflow: auto;
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-xl);
  background: var(--nbd-mb-bg);
  box-shadow: var(--nbd-shadow-dialog);
  transform: translateY(-8px) scale(0.98);
  transition: transform var(--nbd-duration-normal) ease;
}
.nbd-admin-dialog-overlay.is-visible .nbd-admin-dialog {
  transform: translateY(0) scale(1);
}
.nbd-admin-dialog:focus {
  outline: none;
}
.nbd-admin-dialog-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  gap: var(--nbd-space-3);
  align-items: flex-start;
  padding: var(--nbd-space-5) var(--nbd-space-5) var(--nbd-space-3);
}
.nbd-admin-dialog-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--nbd-radius-xl);
  background: var(--nbd-color-info-soft);
  color: var(--nbd-color-info);
  font-size: 22px;
  line-height: 38px;
}
.nbd-admin-dialog.is-success .nbd-admin-dialog-icon {
  background: var(--nbd-color-success-soft);
  color: var(--nbd-color-success);
}
.nbd-admin-dialog.is-warning .nbd-admin-dialog-icon {
  background: var(--nbd-color-warning-soft);
  color: var(--nbd-color-warning);
}
.nbd-admin-dialog.is-error .nbd-admin-dialog-icon {
  background: var(--nbd-color-error-soft);
  color: var(--nbd-color-error);
}
.nbd-admin-dialog-eyebrow {
  margin-bottom: 3px;
  color: var(--nbd-mb-text-mute);
  font-size: var(--nbd-text-xs);
  font-weight: var(--nbd-weight-bold);
  letter-spacing: 0;
  text-transform: uppercase;
}
.nbd-admin-dialog h2 {
  margin: 0;
  color: var(--nbd-mb-text);
  font-size: var(--nbd-text-lg);
  line-height: 1.3;
}
.nbd-admin-dialog-body {
  padding: 0 var(--nbd-space-5) var(--nbd-space-4) calc(var(--nbd-space-5) + 50px);
  color: var(--nbd-mb-text-soft);
  font-size: var(--nbd-text-base);
  line-height: var(--nbd-leading-normal);
}
.nbd-admin-dialog-body p {
  margin: 0 0 var(--nbd-space-2);
}
.nbd-admin-dialog-body ul {
  margin: var(--nbd-space-2) 0 0;
  padding-left: 18px;
  color: var(--nbd-mb-text);
}
.nbd-admin-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--nbd-space-2);
  padding: var(--nbd-space-4) var(--nbd-space-5);
  border-top: 1px solid var(--nbd-mb-border-subtle);
  background: var(--nbd-mb-bg-soft);
}
.nbd-admin-dialog.is-error .nbd-admin-dialog-confirm.button-primary {
  border-color: var(--nbd-color-error);
  background: var(--nbd-color-error);
}
.nbd-admin-dialog.is-warning .nbd-admin-dialog-confirm.button-primary {
  border-color: var(--nbd-color-warning);
  background: var(--nbd-color-warning);
}
.nbd-admin-dialog-confirm.button-primary:hover,
.nbd-admin-dialog-confirm.button-primary:focus {
  filter: brightness(0.94);
}

@media screen and (max-width: 782px) {
  .nbd-admin-toasts {
    top: 56px;
    right: var(--nbd-space-3);
    left: var(--nbd-space-3);
    width: auto;
  }
  .nbd-admin-dialog-overlay {
    align-items: flex-end;
    padding: var(--nbd-space-3);
  }
  .nbd-admin-dialog {
    max-height: calc(100vh - 32px);
  }
  .nbd-admin-dialog-head {
    grid-template-columns: 34px minmax(0, 1fr) 28px;
    padding: var(--nbd-space-4) var(--nbd-space-4) var(--nbd-space-3);
  }
  .nbd-admin-dialog-body {
    padding: 0 var(--nbd-space-4) var(--nbd-space-4);
  }
  .nbd-admin-dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
    padding: var(--nbd-space-3) var(--nbd-space-4);
  }
  .nbd-admin-dialog-actions .button {
    justify-content: center;
    width: 100%;
  }
}

.nbd-modern-ui #wpbody-content {
  padding-bottom: 40px;
}
/* Cool wash on the page canvas so long pages don't read as flat grey.
   Fixed so it stays put while content scrolls; behind everything. */
.nbd-modern-ui #wpwrap { background: var(--nbd-canvas-gradient); background-attachment: fixed; }

/* ---------- PAGE HEADING (maps .wrap > h1) ---------- */
.nbd-modern-ui .wrap > h1,
.nbd-modern-ui .wrap > h1.wp-heading-inline,
.nbd-modern-ui .nbd-page-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 6px 0 20px;
  padding: 20px 26px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
  border-radius: 10px;
  box-shadow: 0 4px 14px -4px rgba(30,58,138,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
  color: #fff;
  font-size: 23px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
/* WP core sets `h1,h2,…{color:#1d2327}` on the element, which beats the
   inherited white above and makes the title unreadable on the blue head.
   Re-assert white for the head title + subtitle. */
.nbd-modern-ui .nbd-page-head h1,
.nbd-modern-ui .nbd-page-head h1.wp-heading-inline,
.nbd-modern-ui .nbd-page-head h2,
.nbd-modern-ui .nbd-page-head .nbd-page-head-sub { color: #fff; }
.nbd-modern-ui .nbd-page-head .nbd-page-head-link {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.nbd-modern-ui .nbd-page-head .nbd-page-head-link:hover,
.nbd-modern-ui .nbd-page-head .nbd-page-head-link:focus {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* "Add New" button rendered inline in WP h1 */
.nbd-modern-ui .wrap > h1 .page-title-action {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  border-radius: var(--nbd-radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
  text-shadow: none;
}
.nbd-modern-ui .wrap > h1 .page-title-action:hover {
  background: rgba(255,255,255,0.28);
  color: #fff;
}

/* ---------- NOTICES ---------- */
.nbd-modern-ui .notice,
.nbd-modern-ui div.updated,
.nbd-modern-ui div.error,
.nbd-modern-ui .nbd-notice {
  padding: var(--nbd-space-3) var(--nbd-space-4);
  background: var(--nbd-mb-bg);
  border-left: 4px solid var(--nbd-mb-primary);
  border-radius: 0 var(--nbd-radius-md) var(--nbd-radius-md) 0;
  box-shadow: var(--nbd-shadow-sm);
  font-size: 13px;
  line-height: 1.5;
}
.nbd-modern-ui .notice-success,
.nbd-modern-ui div.updated { border-left-color: var(--nbd-color-success); }
.nbd-modern-ui .notice-warning { border-left-color: var(--nbd-color-warning); }
.nbd-modern-ui .notice-error,
.nbd-modern-ui div.error { border-left-color: var(--nbd-color-error); }

/* =========================================================
   BUTTONS — map WP .button family
   ========================================================= */
/* Default / secondary button = OUTLINED, lights up blue on hover. */
.nbd-modern-ui .button,
.nbd-modern-ui .button-secondary,
.nbd-modern-ui .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 var(--nbd-space-3);
  border-radius: var(--nbd-radius-xl, 8px);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid var(--nbd-mb-border-light);
  background: var(--nbd-mb-bg);
  color: var(--nbd-mb-text-soft);
  box-shadow: none;
  transition: background 150ms, border-color 150ms, color 150ms, transform 150ms;
  text-shadow: none;
}
.nbd-modern-ui .button:hover,
.nbd-modern-ui .button-secondary:hover,
.nbd-modern-ui .btn:hover {
  background: var(--pc-brand-soft);
  border-color: var(--pc-brand);
  color: var(--pc-brand);
  transform: translateY(-1px);
}

/* Primary stays solid filled brand. */
.nbd-modern-ui .button-primary,
.nbd-modern-ui .btn-primary {
  background: var(--pc-brand);
  border-color: var(--pc-brand);
  color: #fff;
}
.nbd-modern-ui .button-primary:hover,
.nbd-modern-ui .btn-primary:hover {
  background: var(--pc-brand-press, #1d4ed8);
  border-color: var(--pc-brand-press, #1d4ed8);
  color: #fff;
}

.nbd-modern-ui .btn-secondary {
  background: var(--nbd-mb-bg);
  color: var(--nbd-mb-primary);
  border-color: var(--nbd-mb-primary);
}
.nbd-modern-ui .btn-secondary:hover {
  background: var(--nbd-mb-primary-soft);
  border-color: var(--nbd-mb-primary-pressed);
  color: var(--nbd-mb-primary-pressed);
}
/* Danger = OUTLINED red, fills soft-red on hover. */
.nbd-modern-ui .button-link-delete,
.nbd-modern-ui .btn-danger {
  background: var(--nbd-mb-bg);
  border-color: var(--nbd-color-error);
  color: var(--nbd-color-error);
}
.nbd-modern-ui .button-link-delete:hover,
.nbd-modern-ui .btn-danger:hover {
  background: var(--nbd-color-error-soft);
  border-color: var(--nbd-color-error);
  color: var(--nbd-color-error);
}
.nbd-modern-ui .btn-sm { min-height: 26px; padding: 0 var(--nbd-space-2); font-size: 12px; }
.nbd-modern-ui .btn-lg { min-height: 36px; padding: 0 var(--nbd-space-4); font-size: 14px; }

/* Pressed state — the button visibly reacts on click (rule: hover AND active). */
.nbd-modern-ui .button:active,
.nbd-modern-ui .button-primary:active,
.nbd-modern-ui .button-secondary:active,
.nbd-modern-ui .btn:active,
.nbd-modern-ui .btn-primary:active,
.nbd-modern-ui .btn-secondary:active,
.nbd-modern-ui .btn-danger:active,
.nbd-modern-ui .button-link-delete:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.12);
}

/* Accessible keyboard focus for the whole button family — one ring token. */
.nbd-modern-ui .button:focus-visible,
.nbd-modern-ui .button-primary:focus-visible,
.nbd-modern-ui .button-secondary:focus-visible,
.nbd-modern-ui .btn:focus-visible,
.nbd-modern-ui .btn-primary:focus-visible,
.nbd-modern-ui .btn-secondary:focus-visible,
.nbd-modern-ui .btn-danger:focus-visible,
.nbd-modern-ui .button-link-delete:focus-visible {
  outline: none;
  box-shadow: var(--nbd-ring);
}

/* =========================================================
   CARDS — map WP .postbox + provide .nbd-card
   ========================================================= */
.nbd-modern-ui .postbox,
.nbd-modern-ui .nbd-card {
  background: var(--nbd-mb-bg);
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-lg);
  box-shadow: var(--nbd-shadow-md);
  overflow: hidden;
  margin-bottom: var(--nbd-space-4);
  position: relative;
  transition: box-shadow var(--nbd-duration-fast);
}
.nbd-modern-ui .postbox::before,
.nbd-modern-ui .nbd-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--pc-brand-gradient);
  z-index: 1;
}
.nbd-modern-ui .nbd-card.no-accent::before,
.nbd-modern-ui .postbox.no-accent::before { display: none; }
.nbd-modern-ui .postbox.no-accent { overflow: hidden; }
.nbd-modern-ui .postbox:hover,
.nbd-modern-ui .nbd-card:hover { box-shadow: var(--nbd-shadow-lg); }

.nbd-modern-ui .postbox > .postbox-header,
.nbd-modern-ui .postbox > h2,
.nbd-modern-ui .postbox > h3,
.nbd-modern-ui .nbd-card-head {
  margin: 0;
  padding: var(--nbd-space-3) var(--nbd-space-4);
  background: linear-gradient(135deg, #f9fafb, #f3f4f6);
  border-bottom: 1px solid var(--nbd-mb-border-subtle);
  font-size: 14px;
  font-weight: 700;
  color: var(--nbd-mb-text);
}
/* Icon headers: lay the leading dashicon + title out with flex so the gap is a
   single controlled value — not the loose whitespace left by the 20px dashicon
   box plus the literal space in the markup — and any trailing meta that opts in
   with margin-left:auto (e.g. "Admin only", a status pill) lands on the right. */
.nbd-modern-ui .postbox > h2,
.nbd-modern-ui .postbox > h3,
.nbd-modern-ui .nbd-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nbd-modern-ui .postbox > h2 > .dashicons,
.nbd-modern-ui .postbox > h3 > .dashicons,
.nbd-modern-ui .nbd-card-head > .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
  line-height: 1;
  flex: none;
}
.nbd-modern-ui .postbox .inside,
.nbd-modern-ui .nbd-card-body { padding: var(--nbd-space-4); }

.nbd-modern-ui .nbd-card-head.is-brand {
  background: linear-gradient(135deg, var(--pc-brand-soft), #eff6ff);
  border-bottom-color: var(--pc-brand-soft);
}
.nbd-modern-ui .nbd-card-head.is-success {
  background: linear-gradient(135deg, var(--nbd-color-success-soft), #ecfdf5);
}
.nbd-modern-ui .nbd-card-head.is-warning {
  background: linear-gradient(135deg, var(--nbd-color-warning-soft), #fffbeb);
}
.nbd-modern-ui .nbd-card-head.is-danger {
  background: linear-gradient(135deg, var(--nbd-color-error-soft), #fef2f2);
}

/* =========================================================
   STAT / SUMMARY CARDS (component classes for new markup)
   ========================================================= */
.nbd-modern-ui .nbd-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--nbd-space-4);
  margin-bottom: var(--nbd-space-4);
}
@media (max-width: 1279px) { .nbd-modern-ui .nbd-stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .nbd-modern-ui .nbd-stats-grid { grid-template-columns: 1fr; } }

/* Overview body: main column + side rail. Collapses at the same
   breakpoint as .nbd-stats-grid so the whole page degrades together. */
.nbd-modern-ui .nbd-overview-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--nbd-space-4);
  align-items: start;
}
@media (max-width: 1279px) { .nbd-modern-ui .nbd-overview-grid { grid-template-columns: 1fr; } }

.nbd-modern-ui .nbd-b2b-snapshot .inside {
  margin: 0;
  padding: var(--nbd-space-4);
}
.nbd-modern-ui .nbd-b2b-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--nbd-space-3);
}
.nbd-modern-ui .nbd-b2b-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--nbd-space-3);
  min-height: 92px;
  padding: var(--nbd-space-3);
  color: var(--nbd-mb-text);
  text-decoration: none;
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-lg);
  background: var(--nbd-mb-bg);
  box-shadow: var(--nbd-shadow-sm);
}
.nbd-modern-ui .nbd-b2b-card:hover,
.nbd-modern-ui .nbd-b2b-card:focus {
  color: var(--nbd-mb-text);
  text-decoration: none;
  box-shadow: var(--nbd-shadow-md);
  transform: translateY(-1px);
}
.nbd-modern-ui .nbd-b2b-card:focus-visible {
  outline: 2px solid var(--pc-brand);
  outline-offset: 2px;
}
.nbd-modern-ui .nbd-b2b-card.is-info { background: var(--nbd-tint-info); }
.nbd-modern-ui .nbd-b2b-card.is-success { background: var(--nbd-tint-success); }
.nbd-modern-ui .nbd-b2b-card.is-warning { background: var(--nbd-tint-warning); }
.nbd-modern-ui .nbd-b2b-card.is-violet { background: var(--nbd-tint-violet); }
.nbd-modern-ui .nbd-b2b-card.is-danger { background: var(--nbd-color-error-soft); }
.nbd-modern-ui .nbd-b2b-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.nbd-modern-ui .nbd-b2b-label {
  font-size: var(--nbd-text-xs);
  font-weight: var(--nbd-weight-semibold);
  color: var(--nbd-mb-text-soft);
}
.nbd-modern-ui .nbd-b2b-body strong {
  font-size: 22px;
  line-height: var(--nbd-leading-tight);
  font-variant-numeric: tabular-nums;
}
.nbd-modern-ui .nbd-b2b-body span:last-child {
  overflow: hidden;
  color: var(--nbd-mb-text-soft);
  font-size: var(--nbd-text-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nbd-modern-ui .nbd-b2b-card > .dashicons {
  color: var(--nbd-mb-text-mute);
}
@media (max-width: 1279px) { .nbd-modern-ui .nbd-b2b-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .nbd-modern-ui .nbd-b2b-grid { grid-template-columns: 1fr; } }

.nbd-modern-ui .nbd-recent-snapshot .inside {
  margin: 0;
  padding: var(--nbd-space-4);
}
.nbd-modern-ui .nbd-recent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--nbd-space-4);
}
.nbd-modern-ui .nbd-recent-panel {
  overflow: hidden;
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-lg);
  background: var(--nbd-mb-bg);
  box-shadow: var(--nbd-shadow-sm);
}
.nbd-modern-ui .nbd-recent-panel.is-info { background: var(--nbd-tint-info); }
.nbd-modern-ui .nbd-recent-panel.is-success { background: var(--nbd-tint-success); }
.nbd-modern-ui .nbd-recent-panel.is-warning { background: var(--nbd-tint-warning); }
.nbd-modern-ui .nbd-recent-panel.is-violet { background: var(--nbd-tint-violet); }
.nbd-modern-ui .nbd-recent-panel-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--nbd-space-3);
  align-items: center;
  padding: var(--nbd-space-3);
  border-bottom: 1px solid var(--nbd-mb-border-subtle);
}
.nbd-modern-ui .nbd-recent-panel-head strong {
  overflow: hidden;
  color: var(--nbd-mb-text);
  font-size: var(--nbd-text-md);
  line-height: var(--nbd-leading-tight);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nbd-modern-ui .nbd-recent-view-all {
  grid-column: 3;
  color: var(--pc-brand);
  font-size: var(--nbd-text-sm);
  font-weight: var(--nbd-weight-semibold);
  text-decoration: none;
  white-space: nowrap;
}
.nbd-modern-ui .nbd-recent-view-all:hover,
.nbd-modern-ui .nbd-recent-view-all:focus {
  color: var(--pc-brand-press, #1d4ed8);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.nbd-modern-ui .nbd-recent-list {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.5);
}
.nbd-modern-ui .nbd-recent-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 18px;
  gap: var(--nbd-space-3);
  align-items: center;
  min-height: 60px;
  padding: 8px var(--nbd-space-3);
  color: var(--nbd-mb-text);
  text-decoration: none;
}
.nbd-modern-ui .nbd-recent-row + .nbd-recent-row {
  border-top: 1px solid var(--nbd-mb-border-subtle);
}
.nbd-modern-ui .nbd-recent-row:hover,
.nbd-modern-ui .nbd-recent-row:focus {
  background: rgba(255,255,255,0.72);
  color: var(--nbd-mb-text);
  text-decoration: none;
}
.nbd-modern-ui .nbd-recent-row:focus-visible,
.nbd-modern-ui .nbd-recent-view-all:focus-visible {
  outline: 2px solid var(--pc-brand);
  outline-offset: -2px;
}
.nbd-modern-ui .nbd-recent-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--nbd-mb-border-subtle);
  border-radius: var(--nbd-radius-lg);
  background: var(--nbd-mb-bg);
  color: var(--nbd-mb-text-soft);
  flex: none;
}
.nbd-modern-ui .nbd-recent-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.nbd-modern-ui .nbd-recent-thumb .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}
.nbd-modern-ui .nbd-recent-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.nbd-modern-ui .nbd-recent-body strong {
  display: block;
  overflow: hidden;
  color: var(--nbd-mb-text);
  font-size: var(--nbd-text-base);
  line-height: var(--nbd-leading-tight);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nbd-modern-ui .nbd-recent-body span:last-child {
  overflow: hidden;
  color: var(--nbd-mb-text-soft);
  font-size: var(--nbd-text-sm);
  line-height: var(--nbd-leading-normal);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nbd-modern-ui .nbd-recent-row-arrow {
  color: var(--nbd-mb-text-mute);
  font-size: 16px;
  width: 16px;
  height: 16px;
}
.nbd-modern-ui .nbd-recent-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--nbd-space-2);
  min-height: 68px;
  padding: var(--nbd-space-4);
  color: var(--nbd-mb-text-soft);
  font-size: var(--nbd-text-sm);
  line-height: var(--nbd-leading-normal);
}
.nbd-modern-ui .nbd-status-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 120px;
  min-height: 20px;
  padding: 2px 7px;
  overflow: hidden;
  border-radius: 9999px;
  background: var(--nbd-mb-bg-soft);
  color: var(--nbd-mb-text-soft);
  font-size: 10px;
  font-weight: var(--nbd-weight-bold);
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.nbd-modern-ui .nbd-status-mini.is-success { background: var(--nbd-color-success-soft); color: #155724; }
.nbd-modern-ui .nbd-status-mini.is-warning { background: var(--nbd-color-warning-soft); color: #92400e; }
.nbd-modern-ui .nbd-status-mini.is-danger { background: var(--nbd-color-error-soft); color: #b32d2e; }
.nbd-modern-ui .nbd-status-mini.is-info,
.nbd-modern-ui .nbd-status-mini.is-brand { background: var(--nbd-color-info-soft); color: var(--nbd-color-info); }
.nbd-modern-ui .nbd-status-mini.is-violet { background: var(--nbd-color-violet-soft); color: var(--nbd-color-violet); }
.nbd-modern-ui .nbd-status-mini.is-muted { background: var(--nbd-mb-bg-soft); color: var(--nbd-mb-text-mute); }
@media (min-width: 1600px) { .nbd-modern-ui .nbd-recent-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1279px) { .nbd-modern-ui .nbd-recent-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .nbd-modern-ui .nbd-recent-panel-head {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .nbd-modern-ui .nbd-recent-view-all {
    grid-column: 1 / -1;
    margin-left: 42px;
  }
  .nbd-modern-ui .nbd-recent-row {
    grid-template-columns: 44px minmax(0, 1fr) 18px;
  }
  .nbd-modern-ui .nbd-recent-row .nbd-status-mini {
    grid-column: 2 / 3;
    justify-self: flex-start;
  }
}

.nbd-modern-ui .nbd-production-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--nbd-space-4);
  align-items: center;
  margin-bottom: var(--nbd-space-4);
  padding: var(--nbd-space-4);
  background: var(--pc-brand-gradient);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--nbd-radius-lg);
  box-shadow: 0 4px 14px -4px rgba(30,58,138,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
  color: #fff;
}
.nbd-modern-ui .nbd-production-summary.is-success { box-shadow: 0 4px 14px -4px rgba(30,58,138,0.35), inset 4px 0 0 var(--nbd-color-success), inset 0 1px 0 rgba(255,255,255,0.1); }
.nbd-modern-ui .nbd-production-summary.is-warning { box-shadow: 0 4px 14px -4px rgba(30,58,138,0.35), inset 4px 0 0 var(--nbd-color-warning), inset 0 1px 0 rgba(255,255,255,0.1); }
.nbd-modern-ui .nbd-production-summary.is-danger { box-shadow: 0 4px 14px -4px rgba(30,58,138,0.35), inset 4px 0 0 var(--nbd-color-error), inset 0 1px 0 rgba(255,255,255,0.1); }
.nbd-modern-ui .nbd-production-main {
  display: flex;
  gap: var(--nbd-space-3);
  align-items: flex-start;
  min-width: 0;
}
.nbd-modern-ui .nbd-production-icon {
  flex: none;
  width: 34px;
  height: 34px;
  font-size: 34px;
  line-height: 1;
  color: #fff;
}
.nbd-modern-ui .nbd-production-main h1 {
  margin: 0;
  font-size: 20px;
  line-height: var(--nbd-leading-tight);
  color: #fff;
}
.nbd-modern-ui .nbd-production-main p {
  margin: 4px 0 0;
  color: rgba(255,255,255,0.82);
}
.nbd-modern-ui .nbd-production-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nbd-space-2);
  justify-content: flex-end;
}
.nbd-modern-ui .nbd-production-actions .button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nbd-modern-ui .nbd-production-summary .button,
.nbd-modern-ui .nbd-production-summary .button:visited {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.42);
  color: #fff;
}
.nbd-modern-ui .nbd-production-summary .button:hover,
.nbd-modern-ui .nbd-production-summary .button:focus {
  background: rgba(255,255,255,0.26);
  border-color: rgba(255,255,255,0.72);
  color: #fff;
}
.nbd-modern-ui .nbd-production-summary .button-primary,
.nbd-modern-ui .nbd-production-summary .button-primary:visited {
  background: #fff;
  border-color: #fff;
  color: var(--pc-brand);
}
.nbd-modern-ui .nbd-production-summary .button-primary:hover,
.nbd-modern-ui .nbd-production-summary .button-primary:focus {
  background: rgba(255,255,255,0.92);
  border-color: rgba(255,255,255,0.92);
  color: var(--pc-brand-press, #1d4ed8);
}
.nbd-modern-ui .nbd-production-checks {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--nbd-space-2);
}
.nbd-modern-ui .nbd-production-check {
  display: flex;
  justify-content: space-between;
  gap: var(--nbd-space-2);
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid rgba(255,255,255,0.64);
  border-radius: var(--nbd-radius-md);
  color: #475569;
  min-width: 0;
}
.nbd-modern-ui .nbd-production-check strong {
  color: #0f172a;
  text-align: right;
}
.nbd-modern-ui .nbd-production-check.is-success {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}
.nbd-modern-ui .nbd-production-check.is-success strong { color: #15803d; }
.nbd-modern-ui .nbd-production-check.is-warning {
  background: #fffbeb;
  border-color: #facc15;
  color: #854d0e;
}
.nbd-modern-ui .nbd-production-check.is-warning strong { color: #a16207; }
.nbd-modern-ui .nbd-production-check.is-danger {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}
.nbd-modern-ui .nbd-production-check.is-danger strong { color: #b91c1c; }
.nbd-modern-ui .nbd-production-check.is-info {
  background: #ecfeff;
  border-color: #67e8f9;
  color: #155e75;
}
.nbd-modern-ui .nbd-production-check.is-info strong { color: #0e7490; }

.nbd-modern-ui .nbd-quality-warning {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: var(--nbd-space-3);
  align-items: center;
  padding: var(--nbd-space-3);
  background: #fffbeb;
  border: 1px solid #facc15;
  border-left: 4px solid #f59e0b;
  border-radius: var(--nbd-radius-md);
  color: #713f12;
}
.nbd-modern-ui .nbd-quality-warning .dashicons {
  color: #d97706;
  font-size: 22px;
  width: 22px;
  height: 22px;
}
.nbd-modern-ui .nbd-quality-warning strong {
  display: block;
  color: #713f12;
  line-height: var(--nbd-leading-tight);
}
.nbd-modern-ui .nbd-quality-warning p {
  margin: 3px 0 0;
  color: #854d0e;
}
.nbd-modern-ui .nbd-quality-warning .button-primary,
.nbd-modern-ui .nbd-quality-warning .button-primary:visited {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
}
.nbd-modern-ui .nbd-quality-warning .button-primary:hover,
.nbd-modern-ui .nbd-quality-warning .button-primary:focus {
  background: #b45309;
  border-color: #b45309;
  color: #fff;
}

.nbd-modern-ui .nbd-face-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.nbd-modern-ui .nbd-replace-panel {
  margin-top: var(--nbd-space-1);
  border-top: 1px solid var(--nbd-mb-border-subtle);
  padding-top: 10px;
}
.nbd-modern-ui .nbd-replace-panel summary {
  cursor: pointer;
  color: var(--nbd-mb-text-soft);
  font-weight: var(--nbd-weight-semibold);
}
.nbd-modern-ui .nbd-replace-panel summary:hover { color: var(--wp-admin-theme-color, #2271b1); }
.nbd-modern-ui .nbd-replace-panel form {
  display: flex;
  flex-direction: column;
  gap: var(--nbd-space-2);
  margin-top: var(--nbd-space-2);
}
.nbd-modern-ui .nbd-replace-panel label {
  font-size: var(--nbd-text-sm);
  color: var(--nbd-mb-text-soft);
  font-weight: var(--nbd-weight-semibold);
}
.nbd-modern-ui .nbd-replace-panel input[type="file"] {
  width: 100%;
  font-size: var(--nbd-text-sm);
}

.nbd-modern-ui .nbd-file-version-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--nbd-mb-border-subtle);
  font-size: 12px;
}
.nbd-modern-ui .nbd-file-version-row time {
  color: var(--nbd-mb-text-soft);
  white-space: nowrap;
  min-width: 72px;
}
.nbd-modern-ui .nbd-file-version-meta {
  flex: 1;
  min-width: 0;
  color: var(--nbd-mb-text-soft);
}
.nbd-modern-ui .nbd-file-version-row form { margin: 0; }

@media (max-width: 782px) {
  .nbd-modern-ui .nbd-production-summary {
    grid-template-columns: 1fr;
  }
  .nbd-modern-ui .nbd-production-actions {
    justify-content: stretch;
  }
  .nbd-modern-ui .nbd-production-actions .button {
    justify-content: center;
    width: 100%;
  }
  .nbd-modern-ui .nbd-production-checks {
    grid-template-columns: 1fr;
  }
  .nbd-modern-ui .nbd-quality-warning {
    grid-template-columns: 22px minmax(0, 1fr);
  }
  .nbd-modern-ui .nbd-quality-warning .button {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
  }
  .nbd-modern-ui .nbd-file-version-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .nbd-modern-ui .nbd-file-version-meta {
    flex-basis: 100%;
    order: 3;
  }
}

.nbd-modern-ui .nbd-stat-card {
  background: var(--nbd-mb-bg);
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-lg);
  padding: var(--nbd-space-4);
  box-shadow: var(--nbd-shadow-md);
  position: relative;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: all var(--nbd-duration-fast);
}
.nbd-modern-ui .nbd-stat-card:hover,
.nbd-modern-ui .nbd-stat-card:focus {
  color: inherit;
  text-decoration: none;
  box-shadow: var(--nbd-shadow-lg);
  transform: translateY(-2px);
}
.nbd-modern-ui .nbd-stat-card:focus-visible {
  outline: 2px solid var(--pc-brand);
  outline-offset: 2px;
}
.nbd-modern-ui .nbd-stat-card *,
.nbd-modern-ui .nbd-stat-card:hover *,
.nbd-modern-ui .nbd-stat-card:focus * {
  text-decoration: none;
}
.nbd-modern-ui .nbd-stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--pc-brand);
}
.nbd-modern-ui .nbd-stat-card.success::before { background: var(--nbd-color-success); }
.nbd-modern-ui .nbd-stat-card.warning::before { background: var(--nbd-color-warning); }
.nbd-modern-ui .nbd-stat-card.danger::before  { background: var(--nbd-color-error); }
.nbd-modern-ui .nbd-stat-label {
  font-size: 12px;
  color: var(--nbd-mb-text-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nbd-modern-ui .nbd-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--nbd-mb-text);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  margin-top: var(--nbd-space-2);
}

/* =========================================================
   TABLES — map WP .wp-list-table & .widefat
   ========================================================= */
.nbd-modern-ui .wp-list-table,
.nbd-modern-ui table.widefat {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-lg);
  overflow: hidden;
  box-shadow: var(--nbd-shadow-md);
  font-size: 13px;
  background: var(--nbd-mb-bg);
}
.nbd-modern-ui .wp-list-table thead th,
.nbd-modern-ui .wp-list-table thead td,
.nbd-modern-ui table.widefat thead th,
.nbd-modern-ui table.widefat thead td {
  padding: 10px var(--nbd-space-3);
  background: var(--nbd-mb-bg-soft);
  text-align: left;
  font-weight: 600;
  color: var(--nbd-mb-text);
  border-bottom: 1px solid var(--nbd-mb-border-light);
}
.nbd-modern-ui .wp-list-table tbody td,
.nbd-modern-ui table.widefat tbody td {
  padding: 10px var(--nbd-space-3);
  border-bottom: 1px solid var(--nbd-mb-border-subtle);
  color: var(--nbd-mb-text);
  vertical-align: middle;
}
.nbd-modern-ui .wp-list-table tbody tr:last-child td,
.nbd-modern-ui table.widefat tbody tr:last-child td { border-bottom: none; }
.nbd-modern-ui .wp-list-table tbody tr:hover,
.nbd-modern-ui table.widefat tbody tr:hover { background: #fafafa; }
.nbd-modern-ui .wp-list-table tfoot th,
.nbd-modern-ui table.widefat tfoot th {
  background: var(--nbd-mb-bg-soft);
  border-top: 1px solid var(--nbd-mb-border-light);
}

/* =========================================================
   FORMS — map WP .form-table + inputs
   ========================================================= */
.nbd-modern-ui .form-table th {
  padding: var(--nbd-space-4) var(--nbd-space-3) var(--nbd-space-4) 0;
  font-weight: 600;
  color: var(--nbd-mb-text);
  font-size: 13px;
}
.nbd-modern-ui .form-table td { padding: var(--nbd-space-3) 0; }

.nbd-modern-ui input[type="text"],
.nbd-modern-ui input[type="search"],
.nbd-modern-ui input[type="email"],
.nbd-modern-ui input[type="url"],
.nbd-modern-ui input[type="password"],
.nbd-modern-ui input[type="number"],
.nbd-modern-ui select,
.nbd-modern-ui textarea,
.nbd-modern-ui .nbd-input {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--nbd-mb-border);
  border-radius: var(--nbd-radius-sm);
  background: var(--nbd-mb-bg);
  font-size: 13px;
  color: var(--nbd-mb-text);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  transition: all var(--nbd-duration-fast);
}
.nbd-modern-ui input[type="text"]:focus,
.nbd-modern-ui input[type="search"]:focus,
.nbd-modern-ui input[type="email"]:focus,
.nbd-modern-ui input[type="url"]:focus,
.nbd-modern-ui input[type="password"]:focus,
.nbd-modern-ui input[type="number"]:focus,
.nbd-modern-ui select:focus,
.nbd-modern-ui textarea:focus,
.nbd-modern-ui .nbd-input:focus {
  outline: none;
  border-color: var(--nbd-mb-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
  background: #fff;
}
.nbd-modern-ui input[type="checkbox"],
.nbd-modern-ui input[type="radio"] { accent-color: var(--nbd-mb-primary); }

/* Normalise select + text/number input heights so they line up (fixes tall selects) */
.nbd-modern-ui .form-table select,
.nbd-modern-ui select.nbd-input,
.nbd-modern-ui .form-table input[type="text"],
.nbd-modern-ui .form-table input[type="number"],
.nbd-modern-ui input.nbd-input {
  height: 34px;
  min-height: 34px;
  line-height: 1.2;
  box-sizing: border-box;
  vertical-align: middle;
}
.nbd-modern-ui .form-table select,
.nbd-modern-ui select.nbd-input { padding: 0 28px 0 10px; }

/* =========================================================
   NAV TABS — map WP .nav-tab-wrapper / .nav-tab
   ========================================================= */
.nbd-modern-ui .nav-tab-wrapper,
.nbd-modern-ui .nbd-tabs {
  border-bottom: 1px solid var(--nbd-mb-border-light);
  margin: 0 0 var(--nbd-space-4);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.nbd-modern-ui .nav-tab {
  border: none;
  background: transparent;
  margin: 0;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--nbd-mb-text-soft);
  border-bottom: 2px solid transparent;
  border-radius: 0;
  transition: all var(--nbd-duration-fast);
}
.nbd-modern-ui .nav-tab:hover {
  background: var(--nbd-mb-primary-soft);
  color: var(--nbd-mb-primary);
}
.nbd-modern-ui .nav-tab-active,
.nbd-modern-ui .nav-tab-active:focus,
.nbd-modern-ui .nav-tab-active:hover {
  background: transparent;
  color: var(--nbd-mb-primary);
  border-bottom-color: var(--nbd-mb-primary);
}

/* =========================================================
   STATUS PILLS / BADGES (component classes)
   ========================================================= */
.nbd-modern-ui .nbd-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--nbd-radius-full);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  background: var(--nbd-mb-bg-soft);
  color: var(--nbd-mb-text-soft);
}
.nbd-modern-ui .nbd-pill.is-active,
.nbd-modern-ui .nbd-pill.is-success { background: var(--nbd-color-success-soft); color: #155724; }
.nbd-modern-ui .nbd-pill.is-warning { background: var(--nbd-color-warning-soft); color: #92400e; }
.nbd-modern-ui .nbd-pill.is-danger  { background: var(--nbd-color-error-soft); color: #b32d2e; }
.nbd-modern-ui .nbd-pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* =========================================================
   MISC — subsubsub filter row, search box, pagination
   ========================================================= */
.nbd-modern-ui .subsubsub {
  margin: 0 0 var(--nbd-space-3);
  font-size: 13px;
}
.nbd-modern-ui .tablenav {
  background: var(--nbd-mb-bg);
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-md);
  padding: 10px var(--nbd-space-3);
  margin: var(--nbd-space-2) 0;
}
/* Filter row (top): flex-centered so top/bottom spacing inside the box is even */
.nbd-modern-ui .tablenav.top {
  display: flex;
  align-items: center;
  min-height: 0;
  height: auto;
}
.nbd-modern-ui .tablenav.top .actions { padding: 0; margin: 0; }
.nbd-modern-ui .tablenav.top::after,
.nbd-modern-ui .tablenav.top::before { content: none; display: none; }
.nbd-modern-ui .tablenav .tablenav-pages a,
.nbd-modern-ui .tablenav .tablenav-pages span.current {
  border-radius: var(--nbd-radius-sm);
}

/* =========================================================
   PAGINATION — one style plugin-wide. Covers both the legacy
   Nbdesigner_Pagination markup (a.prev-page / a.next-page /
   span.tablenav-pages-navspan for the current page) and the
   newer Prev/Next spans on Files/Orders/Quote (whose arrows are
   .button.btn-sm and inherit the button style).
   ========================================================= */
.nbd-modern-ui .tablenav-pages {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--nbd-space-2);
  float: none;
  margin: 0;
  height: auto;
}
.nbd-modern-ui .displaying-num {
  color: var(--nbd-mb-text-soft);
  font-size: 13px;
  margin: 0;
}
.nbd-modern-ui .pagination-links {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}
/* Numbered links, prev/next arrows, and the current page — square pills. */
.nbd-modern-ui .pagination-links .prev-page,
.nbd-modern-ui .pagination-links .next-page,
.nbd-modern-ui .pagination-links .tablenav-pages-navspan {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 var(--nbd-space-2);
  margin: 0;
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-lg, 6px);
  background: var(--nbd-mb-bg);
  color: var(--nbd-mb-text-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  box-shadow: none;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.nbd-modern-ui .pagination-links a.prev-page:hover,
.nbd-modern-ui .pagination-links a.next-page:hover {
  background: var(--pc-brand-soft);
  border-color: var(--pc-brand);
  color: var(--pc-brand);
}
/* Current page = filled brand, not a link. */
.nbd-modern-ui .pagination-links .tablenav-pages-navspan {
  background: var(--pc-brand);
  border-color: var(--pc-brand);
  color: #fff;
  cursor: default;
}
.nbd-modern-ui .pagination-links a:focus-visible {
  outline: 2px solid var(--pc-brand);
  outline-offset: 2px;
}

/* Filter / search row */
.nbd-modern-ui .nbd-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--nbd-space-2);
  padding: var(--nbd-space-3);
  background: var(--nbd-mb-bg);
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-lg);
  box-shadow: var(--nbd-shadow-sm);
  margin-bottom: var(--nbd-space-3);
}
/* Normalize every control in the filter row to the same height & baseline */
.nbd-modern-ui .nbd-filter-row > * {
  height: 34px;
  margin: 0;
  box-sizing: border-box;
  vertical-align: middle;
}
.nbd-modern-ui .nbd-filter-row select,
.nbd-modern-ui .nbd-filter-row input[type="search"] {
  height: 34px;
  line-height: 1.2;
  padding: 0 10px;
}
.nbd-modern-ui .nbd-filter-row .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  flex-shrink: 0;
}
.nbd-modern-ui .nbd-filter-row .nbd-filter-select { min-width: 160px; }
.nbd-modern-ui .nbd-filter-row .nbd-filter-search { flex: 1; min-width: 200px; max-width: 360px; }

/* Uniform square icon action buttons in tables */
.nbd-modern-ui .nbd-icon-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0 !important;
  vertical-align: middle;
}
.nbd-modern-ui .nbd-icon-btn + .nbd-icon-btn { margin-left: 4px; }
.nbd-modern-ui .nbd-icon-btn .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  line-height: 1;
}

/* Status tabs with counts */
.nbd-modern-ui .nbd-status-tabs {
  margin: 0 0 var(--nbd-space-3);
  padding: 0 0 var(--nbd-space-2);
  border-bottom: 1px solid var(--nbd-mb-border-light);
  font-size: 13px;
  float: none;        /* override WP core .subsubsub float:left */
  clear: both;
  overflow: hidden;
}
.nbd-modern-ui #nbd-orders-bulk { clear: both; }
.nbd-modern-ui .nbd-status-tabs li { display: inline; }
.nbd-modern-ui .nbd-status-tabs a {
  color: var(--nbd-mb-text-soft);
  font-weight: 600;
  padding: 2px 2px;
}
.nbd-modern-ui .nbd-status-tabs a.current { color: var(--nbd-mb-primary); }
.nbd-modern-ui .nbd-status-tabs a .count { color: var(--nbd-mb-text-mute); font-weight: 400; }

/* ===== Settings page layout ===== */
.nbd-modern-ui .nbd-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1100px) {
  .nbd-modern-ui .nbd-settings-layout { grid-template-columns: 1fr; }
}
/* Settings form sits in a card */
.nbd-modern-ui .nbd-settings-main .nbdesigner-settings-form {
  background: var(--nbd-mb-bg);
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-lg);
  box-shadow: var(--nbd-shadow-md);
  padding: 0 20px 20px;
  margin-right: 0 !important;
}
.nbd-modern-ui .nbd-settings-main .nav-tab-wrapper { margin-top: 0; padding-top: 8px; }
.nbd-modern-ui .nbd-settings-main h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 18px 0 6px;
  padding-top: 14px;
  border-top: 1px solid var(--nbd-mb-border-subtle);
}
.nbd-modern-ui .nbd-settings-main h3:first-of-type { border-top: none; }

/* Footer save/reset bar */
.nbd-modern-ui .nbd-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 20px !important;
  padding-top: 16px;
  border-top: 1px solid var(--nbd-mb-border-subtle);
}
.nbd-modern-ui .nbd-footer .button-primary {
  background: var(--pc-accent) !important;
  border-color: var(--pc-accent) !important;
  color: #3b2f00 !important;
  font-weight: 600;
  min-height: 38px;
  padding: 0 22px;
  font-size: 14px;
}
.nbd-modern-ui .nbd-footer .button-primary:hover {
  background: #f5b400 !important;
  border-color: #f5b400 !important;
  color: #3b2f00 !important;
}
.nbd-modern-ui .nbd-footer .button-secondary {
  min-height: 38px;
  padding: 0 18px;
}

/* ===== License page hero + badge ===== */
.nbd-modern-ui .nbd-lic-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  margin: 0 0 16px;
  border-radius: var(--nbd-radius-lg);
  border: 1px solid var(--nbd-color-success-soft);
  background: linear-gradient(135deg, var(--nbd-color-success-soft), #ecfdf5);
}
.nbd-modern-ui .nbd-lic-hero.is-expired {
  border-color: var(--nbd-color-error-soft);
  background: linear-gradient(135deg, var(--nbd-color-error-soft), #fef2f2);
}
.nbd-modern-ui .nbd-lic-hero-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--nbd-color-success);
  color: #fff;
  font-size: 24px;
  flex-shrink: 0;
}
.nbd-modern-ui .nbd-lic-hero.is-expired .nbd-lic-hero-icon { background: var(--nbd-color-error); }
.nbd-modern-ui .nbd-lic-hero-title { font-size: 16px; font-weight: 700; color: var(--nbd-mb-text); }
.nbd-modern-ui .nbd-lic-hero-meta { font-size: 13px; color: var(--nbd-mb-text-soft); margin-top: 2px; }
.nbd-modern-ui .nbd-lic-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 12px; border-radius: var(--nbd-radius-full);
  font-size: 12px; font-weight: 700;
  background: var(--nbd-mb-bg-soft); color: var(--nbd-mb-text-soft);
}
.nbd-modern-ui .nbd-lic-badge.is-pro { background: linear-gradient(135deg,#fbbf24,#d97706); color: #fff; }

/* ===== License block ===== */
.nbd-modern-ui .nbd-license {
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-lg);
  background: var(--nbd-mb-bg);
  box-shadow: var(--nbd-shadow-md);
  margin: 0 0 24px;
  overflow: hidden;
}
.nbd-modern-ui .nbd-license h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f9fafb, #f3f4f6);
  border-bottom: 1px solid var(--nbd-mb-border-subtle);
  font-size: 14px;
  font-weight: 700;
}
.nbd-modern-ui .nbd-license h3 .dashicons { color: var(--pc-brand); }
.nbd-modern-ui .nbd-license h3 span { font-weight: 400; color: var(--nbd-mb-text-soft); }
.nbd-modern-ui .nbd-license h3 b { color: var(--nbd-mb-text); }
.nbd-modern-ui .nbd-license .nbd_support {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px !important;
  border: 1px solid var(--nbd-mb-primary) !important;
  border-radius: var(--nbd-radius-sm) !important;
  color: var(--nbd-mb-primary) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: all var(--nbd-duration-fast);
  float: none !important;
  background: none !important;
  margin-top: 0 !important;
  line-height: 1.2 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
.nbd-modern-ui .nbd-license .nbd_support::before {
  content: "\f223";
  font-family: dashicons;
  font-size: 15px;
  line-height: 1;
}
.nbd-modern-ui .nbd-license .nbd_support:hover {
  background: var(--nbd-mb-primary-soft) !important;
  color: var(--nbd-mb-primary-pressed) !important;
}
.nbd-modern-ui .nbd-license .form-table { padding: 12px 24px 20px; margin: 0; }
.nbd-modern-ui .nbd-license .form-table th {
  padding: 14px 16px 14px 20px;
  width: 200px;
  vertical-align: middle;
  font-weight: 600;
  color: var(--nbd-mb-text);
}
.nbd-modern-ui .nbd-license .form-table td { padding: 14px 20px 14px 0; vertical-align: middle; }
.nbd-modern-ui .nbd-license .form-table td br { display: none; }

/* All license inputs: identical size */
.nbd-modern-ui .nbd-license input.regular-text {
  display: block;
  width: 320px;
  max-width: 100%;
  height: 38px;
  margin: 0 0 12px;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: var(--nbd-radius-sm);
}
/* email + key inputs sit inline with their buttons */
.nbd-modern-ui .nbd-license input[name="nbdesigner[email]"],
.nbd-modern-ui .nbd-license #nbdesigner_active_license input.regular-text {
  display: inline-block;
  margin-bottom: 0;
  vertical-align: middle;
}
/* All license buttons: identical size, aligned with inputs */
.nbd-modern-ui .nbd-license .button-primary {
  height: 38px;
  min-height: 38px;
  padding: 0 20px;
  margin: 0 0 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  font-weight: 600;
  font-size: 13px;
  line-height: 1 !important;
  box-sizing: border-box;
  border-radius: var(--nbd-radius-sm);
}
.nbd-modern-ui .nbd-license #nbdesigner_get_key { display: inline-flex; }
.nbd-modern-ui .nbd-license .description { margin-top: 8px; }
.nbd-modern-ui .nbd-license .description small { color: var(--nbd-mb-text-mute); font-size: 12px; }
.nbd-modern-ui .nbd-license hr { border: none; border-top: 1px solid var(--nbd-mb-border-subtle); margin: 8px 0; }
.nbd-modern-ui .nbd-license #nbdesigner_remove_key { background: var(--nbd-color-error); border-color: var(--nbd-color-error); color: #fff !important; text-shadow: none; }
.nbd-modern-ui .nbd-license #nbdesigner_remove_key:hover,
.nbd-modern-ui .nbd-license #nbdesigner_remove_key:focus { background: #b32d2e; border-color: #b32d2e; color: #fff !important; }

/* Upgrade Pro version link */
.nbd-modern-ui .nbd-license .nbd-notice-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  height: 32px;
  padding: 0 16px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--pc-accent);
  background: rgba(245, 180, 0, 0.1);
  color: #c48a00;
  transition: all var(--nbd-duration-fast);
}
.nbd-modern-ui .nbd-license .nbd-notice-action:hover {
  background: var(--pc-accent);
  color: #3b2f00;
  border-color: var(--pc-accent);
}

/* ===== License page A1 — key form, badges, banner, feature table ===== */
/* Modern "License key" component body */
.nbd-modern-ui .nbd-lic-body { padding: 16px 20px 18px; }
.nbd-modern-ui .nbd-lic-key-label {
  display: block;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em;
  color: var(--nbd-mb-text-soft);
  margin: 0 0 8px;
}
.nbd-modern-ui .nbd-lic-key-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.nbd-modern-ui .nbd-lic-key-row input.regular-text { margin: 0; width: 340px; max-width: 100%; }
.nbd-modern-ui .nbd-lic-key-row .button,
.nbd-modern-ui .nbd-lic-key-row .button-primary { height: 38px; min-height: 38px; margin: 0; padding: 0 18px; }
.nbd-modern-ui .nbd-lic-key-msg { margin-top: 8px; min-height: 16px; }
.nbd-modern-ui .nbd-lic-key-msg small { font-size: 12px; }
.nbd-modern-ui .nbd-lic-key-msg .nbd-lic-key-warn { display: block; margin-top: 4px; color: #b32d2e; }

/* Tier badge variants (3 values) + trial hero */
.nbd-modern-ui .nbd-lic-badge.is-trial { background: linear-gradient(135deg, #60a5fa, #2563eb); color: #fff; }
.nbd-modern-ui .nbd-lic-badge.is-lite  { background: var(--nbd-mb-bg-soft); color: var(--nbd-mb-text-soft); }
.nbd-modern-ui .nbd-lic-hero-main { flex: 1; min-width: 0; }
.nbd-modern-ui .nbd-lic-hero-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nbd-modern-ui .nbd-lic-hero.is-trial {
  border-color: var(--nbd-color-warning-soft);
  background: linear-gradient(135deg, var(--nbd-color-warning-soft), #fffbeb);
}
.nbd-modern-ui .nbd-lic-hero.is-trial .nbd-lic-hero-icon { background: var(--nbd-color-warning); }

/* Contextual CTA banner (trial ended / license expired) */
.nbd-modern-ui .nbd-lic-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; margin: 0 0 16px;
  border-radius: var(--nbd-radius-lg);
  border: 1px solid var(--pc-accent);
  background: rgba(245, 180, 0, 0.08);
}
.nbd-modern-ui .nbd-lic-banner > .dashicons { color: #c48a00; font-size: 24px; width: 24px; height: 24px; flex-shrink: 0; }
.nbd-modern-ui .nbd-lic-banner-txt { flex: 1; min-width: 0; font-size: 13px; color: var(--nbd-mb-text); }
.nbd-modern-ui .nbd-lic-banner-txt strong { display: block; font-size: 14px; margin-bottom: 2px; }
.nbd-modern-ui .nbd-lic-banner .button { flex-shrink: 0; }
.nbd-modern-ui .nbd-lic-banner.is-danger { border-color: var(--nbd-color-error); background: var(--nbd-color-error-soft); }
.nbd-modern-ui .nbd-lic-banner.is-danger > .dashicons { color: var(--nbd-color-error); }

/* Feature comparison table */
.nbd-modern-ui .nbd-feat-table th.nbd-feat-col { text-align: center; width: 130px; }
.nbd-modern-ui .nbd-feat-table td.nbd-feat-cell { text-align: center; }
.nbd-modern-ui .nbd-feat-table td.nbd-feat-cell.is-current { background: var(--pc-brand-soft); }
.nbd-modern-ui .nbd-feat-yes { color: var(--nbd-color-success); }
.nbd-modern-ui .nbd-feat-no  { color: var(--nbd-mb-text-mute); }
.nbd-modern-ui .nbd-feat-val { font-weight: 600; }

/* Read-only domain chips */
.nbd-modern-ui .nbd-lic-domains { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nbd-modern-ui .nbd-lic-domains code { padding: 3px 8px; border-radius: var(--nbd-radius-sm); background: var(--nbd-mb-bg-soft); font-size: 12px; }

/* View-only note */
.nbd-modern-ui .nbd-lic-note { font-size: 12px; color: var(--nbd-mb-text-mute); margin: 12px 0 0; line-height: 1.6; }
.nbd-modern-ui .nbd-lic-note .dashicons { font-size: 14px; width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.nbd-modern-ui .nbd-lic-note a { text-decoration: none; }

/* Sidebar cards: clean white header, no detached strip, tight top */
.nbd-modern-ui .nbd-settings-aside .postbox { overflow: hidden; }
.nbd-modern-ui .nbd-settings-aside .postbox > h2 {
  background: #fff !important;
  border-bottom: 1px solid var(--nbd-mb-border-light);
  margin: 0;
  padding: 14px 16px !important;
  font-size: 14px;
  font-weight: 700;
}

/* Quick info rows */
.nbd-modern-ui .nbd-qi-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--nbd-mb-border-subtle);
  font-size: 13px;
}
.nbd-modern-ui .nbd-qi-row span { color: var(--nbd-mb-text-soft); text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
.nbd-modern-ui .nbd-help-link {
  display: block;
  padding: 8px 16px;
  text-decoration: none;
  font-size: 13px;
}
.nbd-modern-ui .nbd-help-link:hover { background: var(--nbd-mb-bg-soft); }

/* Card link rows (Quick actions, Top products, etc.) — no underline */
.nbd-modern-ui .postbox .inside a { text-decoration: none; }
.nbd-modern-ui .postbox .inside a:hover { text-decoration: none; }
.nbd-modern-ui .postbox .inside a[style*="border-bottom"]:hover,
.nbd-modern-ui .postbox .inside a:hover > span:first-child { color: var(--nbd-mb-primary); }

/* ===== List-page banner: span full width BELOW floated Screen Options / Help tabs ===== */
.nbd-modern-ui .wrap > h1 { clear: both; }

/* Links & buttons inside the gradient banner (e.g. Templates-for header) */
.nbd-modern-ui .wrap > h1 a:not(.button):not(.button-primary):not(.page-title-action):not(.nbd-page-title-action) {
  color: #fff;
  text-decoration: underline;
}
.nbd-modern-ui .wrap > h1 .button,
.nbd-modern-ui .wrap > h1 .button-primary {
  display: inline-flex;
  align-items: center;
  height: 30px;
  margin-left: 8px;
  padding: 0 14px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: var(--nbd-radius-sm);
  color: #fff;
  font-weight: 600;
  box-shadow: none;
  text-shadow: none;
}
.nbd-modern-ui .wrap > h1 .button:hover,
.nbd-modern-ui .wrap > h1 .button-primary:hover {
  background: rgba(255,255,255,0.30);
  border-color: #fff;
  color: #fff;
}
.nbd-modern-ui .wrap > h1 .nbdesigner-right { float: right; }

/* "Add new" buttons inside the banner */
.nbd-modern-ui .wrap > h1 .page-title-action,
.nbd-modern-ui .wrap > h1 .nbd-page-title-action {
  margin-left: 12px;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: var(--nbd-radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: none;
  text-shadow: none;
}
.nbd-modern-ui .wrap > h1 .page-title-action:hover,
.nbd-modern-ui .wrap > h1 .nbd-page-title-action:hover {
  background: rgba(255,255,255,0.30);
  color: #fff;
}

/* ===== Printing Options: tidy icon buttons & action controls ===== */
.nbd-modern-ui .nbd-option-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.nbd-modern-ui .nbd-field-btn,
.nbd-modern-ui .nbd-mini-btn,
.nbd-modern-ui .nbd-option-actions .button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nbd-modern-ui .nbd-mini-btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
}
.nbd-modern-ui .field-action,
.nbd-modern-ui .nbd-group-actions,
.nbd-modern-ui .nbd-attribute-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nbd-modern-ui .nbo-sort-group { display: inline-flex; flex-direction: column; justify-content: center; line-height: 0; }
.nbd-modern-ui .button .dashicons,
.nbd-modern-ui .button-primary .dashicons,
.nbd-modern-ui .nbd-option-actions .dashicons,
.nbd-modern-ui .nbd-mini-btn .dashicons,
.nbd-modern-ui .nbd-field-btn .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  line-height: 1;
  vertical-align: middle;
}
.nbd-modern-ui .nbo-sort {
  font-size: 14px;
  width: 14px;
  height: 14px;
  line-height: 1;
  cursor: pointer;
}
.nbd-modern-ui .remove-attribute-img.dashicons-no,
.nbd-modern-ui .remove-group-img.dashicons-no {
  line-height: 1.4;
  vertical-align: middle;
}

/* ===== Get Quote form builder ===== */
.nbd-modern-ui .nbd-quote-wrap #nbdq-add-field {
  background: var(--nbd-mb-bg);
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-lg);
  box-shadow: var(--nbd-shadow-sm);
  padding: 14px 16px;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.nbd-modern-ui .nbd-quote-wrap #nbdq-add-field h4 {
  width: 100%;
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
}
.nbd-modern-ui .nbd-quote-wrap #nbdq-add-field label { color: var(--nbd-mb-text-soft); }
.nbd-modern-ui .nbd-quote-wrap #nbdq-add-field input[type="text"] { min-width: 240px; }
.nbd-modern-ui .nbd-quote-wrap .fields_table_bulk_actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}
.nbd-modern-ui .nbd-quote-wrap .fields_table_bulk_actions select,
.nbd-modern-ui .nbd-quote-wrap .fields_table_bulk_actions .button {
  height: 34px;
  min-height: 34px;
  line-height: 1.2;
  box-sizing: border-box;
  margin: 0;
  display: inline-flex;
  align-items: center;
}
.nbd-modern-ui .nbd-quote-wrap #nbdq_form_fields { margin-bottom: 12px; }
.nbd-modern-ui .nbd-quote-wrap .save-form {
  min-height: 38px;
  padding: 0 22px;
  font-size: 14px;
}

/* ===== Product images grid ===== */
.nbd-modern-ui .nbd-img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}
.nbd-modern-ui .nbd-img-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-md);
  overflow: hidden;
  background: var(--nbd-mb-bg-soft);
  cursor: pointer;
}
.nbd-modern-ui .nbd-img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nbd-modern-ui .nbd-img-tile .nbd-img-badge {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  background: var(--pc-brand); color: #fff;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 2px 8px; border-radius: var(--nbd-radius-full);
}
.nbd-modern-ui .nbd-img-tile .nbd-img-x {
  position: absolute; top: 5px; right: 5px; z-index: 3;
  width: 20px; height: 20px; padding: 0; border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 14px; line-height: 20px; text-align: center;
  cursor: pointer;
}
.nbd-modern-ui .nbd-img-tile .nbd-img-x:hover { background: var(--nbd-color-error); color: #fff; }

/* wp_editor (Description) — full width inside the field for easier editing */
.nbd-modern-ui .nbd-editor-wrap { max-width: none; width: 100%; }
.nbd-modern-ui .nbd-editor-wrap .wp-editor-container,
.nbd-modern-ui .nbd-editor-wrap .wp-editor-wrap { border-radius: var(--nbd-radius-md); width: 100%; }
.nbd-modern-ui .nbd-editor-wrap .wp-editor-area { width: 100%; box-sizing: border-box; }
/* Let the Description cell use the full column width */
.nbd-modern-ui .form-table td:has(.nbd-editor-wrap) { max-width: none; width: auto; }

/* WP list-table filter row (e.g. templates tab: "Show all design" + Filter) — equal heights, aligned */
.nbd-modern-ui .tablenav .actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nbd-modern-ui .tablenav .actions select,
.nbd-modern-ui .tablenav .actions input[type="text"],
.nbd-modern-ui .tablenav .actions input[type="search"],
.nbd-modern-ui .tablenav .actions .button,
.nbd-modern-ui .tablenav .actions .button-primary,
.nbd-modern-ui .tablenav .actions input[type="submit"],
.nbd-modern-ui .tablenav select,
.nbd-modern-ui .tablenav .button,
.nbd-modern-ui .tablenav .button-primary,
.nbd-modern-ui .tablenav input[type="submit"] {
  height: 36px !important;
  min-height: 36px;
  line-height: 34px;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  vertical-align: middle;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
}

/* ===== AI tool cards ===== */
.nbd-modern-ui .nbd-tool-card {
  background: var(--nbd-mb-bg);
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-lg);
  box-shadow: var(--nbd-shadow-sm);
  margin: 0 0 16px;
  overflow: hidden;
}
.nbd-modern-ui .nbd-tool-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  border-bottom: 1px solid var(--nbd-mb-border-subtle);
}
.nbd-modern-ui .nbd-tool-icon { color: var(--pc-brand); font-size: 20px; width: 20px; height: 20px; }
.nbd-modern-ui .nbd-tool-title { font-size: 15px; font-weight: 700; }
.nbd-modern-ui .nbd-tool-body { padding: 16px; }
.nbd-modern-ui .nbd-tool-desc { color: var(--nbd-mb-text-soft); margin: 0 0 14px; font-size: 13px; line-height: 1.5; }
.nbd-modern-ui .nbd-tool-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0;
}
.nbd-modern-ui .nbd-tool-hint { color: var(--nbd-mb-text-mute); font-size: 12px; }
.nbd-modern-ui .nbd-cost-title {
  margin: 14px 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--nbd-mb-text-soft);
}
.nbd-modern-ui .nbd-cost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.nbd-modern-ui .nbd-cost-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--nbd-mb-bg-soft);
  border: 1px solid var(--nbd-mb-border-subtle);
  border-radius: var(--nbd-radius-md);
  font-size: 13px;
}
.nbd-modern-ui .nbd-cost-item strong { color: var(--pc-brand); }

/* Toggle switch */
.nbd-modern-ui .nbd-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.nbd-modern-ui .nbd-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nbd-modern-ui .nbd-switch-slider {
  width: 40px; height: 22px;
  background: var(--nbd-mb-border);
  border-radius: 22px;
  transition: background var(--nbd-duration-fast);
  position: relative;
  flex-shrink: 0;
}
.nbd-modern-ui .nbd-switch-slider::before {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform var(--nbd-duration-fast);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.nbd-modern-ui .nbd-switch input:checked + .nbd-switch-slider { background: var(--nbd-color-success); }
.nbd-modern-ui .nbd-switch input:checked + .nbd-switch-slider::before { transform: translateX(18px); }

/* Order status timeline */
.nbd-modern-ui .nbd-timeline { display: flex; align-items: flex-start; }
.nbd-modern-ui .nbd-tl-step {
  flex: 1;
  position: relative;
  text-align: center;
  padding-top: 34px;
}
.nbd-modern-ui .nbd-tl-step::before {
  content: "";
  position: absolute;
  top: 13px;
  left: -50%; right: 50%;   /* connect the previous dot centre to this dot centre — continuous line */
  height: 3px;
  background: var(--nbd-mb-border-light);
  z-index: 0;
}
.nbd-modern-ui .nbd-tl-step:first-child::before { display: none; }
.nbd-modern-ui .nbd-tl-dot { z-index: 1; }
.nbd-modern-ui .nbd-tl-step.done::before,
.nbd-modern-ui .nbd-tl-step.current::before { background: var(--nbd-color-success); }
.nbd-modern-ui .nbd-tl-dot {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--nbd-mb-border);
  color: var(--nbd-mb-text-mute);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}
.nbd-modern-ui .nbd-tl-step.done .nbd-tl-dot { background: var(--nbd-color-success); border-color: var(--nbd-color-success); color: #fff; }
.nbd-modern-ui .nbd-tl-step.current .nbd-tl-dot { background: var(--pc-brand); border-color: var(--pc-brand); color: #fff; box-shadow: 0 0 0 4px var(--pc-brand-soft); }
.nbd-modern-ui .nbd-tl-label { display: block; font-size: 13px; color: var(--nbd-mb-text); font-weight: 600; }
.nbd-modern-ui .nbd-tl-step.current .nbd-tl-label { color: var(--pc-brand); font-weight: 700; }
.nbd-modern-ui .nbd-tl-sub { display: block; font-size: 11px; color: var(--nbd-mb-text-mute); margin-top: 2px; }
.nbd-modern-ui .nbd-tl-step.current .nbd-tl-sub { color: var(--pc-brand); }
.nbd-modern-ui .nbd-tl-dot .dashicons { font-size: 16px; width: 16px; height: 16px; line-height: 16px; }

/* Amber "Approve & start production" in the hero */
.nbd-modern-ui .nbd-page-head .nbd-approve-btn {
  background: var(--pc-accent) !important;
  border-color: var(--pc-accent) !important;
  color: #3b2f00 !important;
  font-weight: 700;
}
.nbd-modern-ui .nbd-page-head .nbd-approve-btn:hover { background: #f5b400 !important; border-color: #f5b400 !important; color: #3b2f00 !important; }

/* Buttons sitting inside the gradient page-head (Orders: Create order / Export CSV) */
.nbd-modern-ui .nbd-page-head .button,
.nbd-modern-ui .nbd-page-head .button:visited {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: var(--nbd-radius-sm);
  color: #fff;
  font-weight: 600;
  box-shadow: none;
  text-shadow: none;
}
.nbd-modern-ui .nbd-page-head .button:hover,
.nbd-modern-ui .nbd-page-head .button:focus {
  background: rgba(255,255,255,0.30);
  border-color: #fff;
  color: #fff;
}
.nbd-modern-ui .nbd-page-head .button .dashicons { font-size: 16px; width: 16px; height: 16px; }

/* Inline button spinner */
.nbd-modern-ui .nbd-spin {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: nbd-spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
.nbd-modern-ui .button:not(.button-primary) .nbd-spin { border-color: rgba(0,0,0,0.25); border-top-color: var(--nbd-mb-primary); }
@keyframes nbd-spin { to { transform: rotate(360deg); } }

/* Searchable combobox (Create order modal) */
.nbd-modern-ui .nbd-combo { position: relative; }
.nbd-modern-ui .nbd-combo-input { width: 100%; }
.nbd-modern-ui .nbd-combo-list {
  display: none;
  position: absolute;
  left: 0; right: 0; top: calc(100% + 2px);
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--nbd-mb-border);
  border-radius: var(--nbd-radius-md);
  box-shadow: var(--nbd-shadow-lg);
}
.nbd-modern-ui .nbd-combo-opt {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}
.nbd-modern-ui .nbd-combo-opt:hover { background: var(--nbd-mb-primary-soft); color: var(--nbd-mb-primary); }
.nbd-modern-ui .nbd-combo-empty { padding: 8px 12px; font-size: 13px; color: var(--nbd-mb-text-mute); }

/* Create-order modal fields */
.nbd-modern-ui .nbd-co-field { margin-bottom: 16px; }
.nbd-modern-ui .nbd-co-field > label:first-child {
  display: block;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--nbd-mb-text-soft);
  margin-bottom: 6px;
}
.nbd-modern-ui #nbd-create-order-modal .nbd-input,
.nbd-modern-ui #nbd-create-order-modal select,
.nbd-modern-ui #nbd-create-order-modal textarea {
  min-height: 38px;
  border-radius: var(--nbd-radius-md);
}
/* Design-file radio cards */
.nbd-modern-ui .nbd-co-radios { display: flex; gap: 8px; flex-wrap: wrap; }
.nbd-modern-ui .nbd-co-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid var(--nbd-mb-border);
  border-radius: var(--nbd-radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--nbd-duration-fast);
}
.nbd-modern-ui .nbd-co-radio:hover { border-color: var(--nbd-mb-primary); }
.nbd-modern-ui .nbd-co-radio:has(input:checked) {
  border-color: var(--pc-brand);
  background: var(--pc-brand-soft);
  font-weight: 600;
}
/* Rush checkbox row */
.nbd-modern-ui .nbd-co-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 400 !important;
  font-size: 13px;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--nbd-mb-text) !important;
}
.nbd-modern-ui #nbd-co-file {
  display: block;
  font-size: 13px;
  padding: 8px;
  border: 1px dashed var(--nbd-mb-border);
  border-radius: var(--nbd-radius-md);
  width: 100%;
  background: var(--nbd-mb-bg-soft);
}
/* Modal footer — buttons keep their natural width (fix clipped Cancel) */
.nbd-modern-ui .nbd-modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--nbd-mb-border-light);
  background: var(--nbd-mb-bg-soft);
}
.nbd-modern-ui .nbd-modal-foot .button {
  width: auto;
  min-width: 0;
  height: 36px;
  padding: 0 16px;
}
/* Header close button stays square */
.nbd-modern-ui .nbd-modal-head .nbd-modal-close { flex-shrink: 0; }

/* ===== Modal (Token Wallet) ===== */
.nbd-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.nbd-modal-overlay .nbd-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.nbd-modal-overlay .nbd-modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--nbd-mb-border-light);
  background: linear-gradient(135deg, #f9fafb, #f3f4f6);
}
.nbd-modal-overlay .nbd-modal-head .dashicons { color: var(--pc-brand); }
.nbd-modal-overlay .nbd-modal-head strong { font-size: 15px; }
.nbd-modal-overlay .nbd-modal-close {
  margin-left: auto;
  width: 30px; height: 30px;
  border-radius: var(--nbd-radius-sm);
  font-size: 22px;
  line-height: 1;
  color: var(--nbd-mb-text-mute);
  background: transparent;
}
.nbd-modal-overlay .nbd-modal-close:hover { background: var(--nbd-mb-bg-soft); color: var(--nbd-mb-text); }
.nbd-modal-overlay .nbd-modal-body { overflow: auto; }
.nbd-modal-overlay .nbd-wallet-iframe { display: block; }

/* ===== Template library — cards (spec templates-dashboard.md §5.2) =====
   Matte "gallery" cards: template art keeps its true aspect on a soft dot-grid
   matte (object-fit:contain — never crop), 3 per row on desktop degrading to
   2 then 1. The grid is rendered empty server-side; nbd-template-library.js
   injects the cards. Card markup contract lives in TPL-CONTRACT.md §3. */
.nbd-modern-ui .nbd-tpl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1280px) { .nbd-modern-ui .nbd-tpl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 782px)  { .nbd-modern-ui .nbd-tpl-grid { grid-template-columns: 1fr; } }

.nbd-modern-ui .nbd-tpl-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-xl);
  background: var(--nbd-mb-bg);
  box-shadow: var(--nbd-shadow-sm);
  overflow: hidden;
  transition: box-shadow 180ms ease, transform 180ms ease, border-color 180ms ease;
}
.nbd-modern-ui .nbd-tpl-card:hover {
  box-shadow: var(--nbd-shadow-xl);
  transform: translateY(-3px);
  border-color: var(--pc-brand-soft);
}
.nbd-modern-ui .nbd-tpl-card:focus-visible {
  outline: 2px solid var(--pc-brand);
  outline-offset: 2px;
}

/* THUMB — matte gallery frame, keeps aspect (contain, not cover) */
.nbd-modern-ui .nbd-tpl-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background:
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.04) 1px, transparent 0) 0 0 / 16px 16px,
    var(--nbd-mb-bg-soft);
}
.nbd-modern-ui .nbd-tpl-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14); /* soft "hung artwork" drop */
}

/* Preview overlay — only surfaces on hover / keyboard focus (a11y-safe) */
.nbd-modern-ui .nbd-tpl-thumb .nbd-tpl-preview {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.32);
  opacity: 0;
  transition: opacity 160ms ease;
}
.nbd-modern-ui .nbd-tpl-card:hover .nbd-tpl-preview,
.nbd-modern-ui .nbd-tpl-card:focus-within .nbd-tpl-preview,
.nbd-modern-ui .nbd-tpl-preview:focus-visible { opacity: 1; }
.nbd-modern-ui .nbd-tpl-preview:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.nbd-modern-ui .nbd-tpl-preview .dashicons {
  width: 34px;
  height: 34px;
  font-size: 20px;
  line-height: 34px;
  text-align: center;
  color: #fff;
  border-radius: var(--nbd-radius-full);
  background: rgba(15, 23, 42, 0.55);
}

/* Badges on the thumb */
.nbd-modern-ui .nbd-tpl-badge {
  position: absolute;
  top: 10px;
  z-index: 1;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 9px;
  border-radius: var(--nbd-radius-full);
  backdrop-filter: blur(4px);
}
.nbd-modern-ui .nbd-tpl-badge--cat { left: 10px; background: rgba(255, 255, 255, 0.82); color: var(--nbd-mb-text); }
.nbd-modern-ui .nbd-tpl-badge--pro { right: 10px; background: var(--pc-accent); color: var(--nbd-mb-text); }

/* BODY */
.nbd-modern-ui .nbd-tpl-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
}
.nbd-modern-ui .nbd-tpl-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--nbd-mb-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden; /* 2 lines then ellipsis; full name kept in title + lightbox caption */
}
.nbd-modern-ui .nbd-tpl-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--nbd-mb-text-soft);
}
.nbd-modern-ui .nbd-tpl-status .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.nbd-modern-ui .nbd-tpl-status.is-assigned .dot { background: var(--nbd-color-success); }
.nbd-modern-ui .nbd-tpl-status.not-assigned .dot { background: var(--nbd-mb-border); }
.nbd-modern-ui .nbd-tpl-body .btn { width: 100%; justify-content: center; }

/* AI service banner */
.nbd-modern-ui .nbd-ai-banner {
  display: flex;
  align-items: center;
  gap: var(--nbd-space-4);
  padding: 16px 20px;
  margin-bottom: var(--nbd-space-4);
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 50%, #9333ea 100%);
  box-shadow: 0 4px 14px -4px rgba(109,40,217,0.45);
}
.nbd-modern-ui .nbd-ai-banner .nbd-ai-banner-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.18);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.nbd-modern-ui .nbd-ai-banner .nbd-ai-banner-icon .dashicons { font-size: 24px; width: 24px; height: 24px; }
.nbd-modern-ui .nbd-ai-banner .button {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}
.nbd-modern-ui .nbd-ai-banner .button:hover {
  background: rgba(255,255,255,0.28);
  color: #fff;
}

/* ===== Product thumbnail — 40x40 standard (orders, products, overview) =====
   One home for the .nbd-thumb pattern that views used to inline. Call sites
   that still inline their own width/height (52px hero) keep overriding these. */
.nbd-modern-ui .nbd-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--nbd-radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--nbd-mb-bg-soft);
}
.nbd-modern-ui .nbd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* No product image — centered placeholder glyph.
   ::before covers markup that only adds the class; the .dashicons rule covers
   markup that renders a real <span class="dashicons dashicons-format-image">. */
.nbd-modern-ui .nbd-thumb.is-empty::before {
  content: "\f128";
  font-family: dashicons;
  font-size: 20px;
  line-height: 1;
  color: var(--nbd-mb-text-mute);
}
.nbd-modern-ui .nbd-thumb .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
  line-height: 1;
  color: var(--nbd-mb-text-mute);
}
/* Hero avatar (order/product detail) — fill the whole box */
.nbd-modern-ui .nbd-page-head .nbd-thumb { padding: 0; }
.nbd-modern-ui .nbd-page-head .nbd-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}
.nbd-modern-ui .wp-list-table .button.btn-sm { padding: 0 6px; min-height: 26px; }
.nbd-modern-ui .wp-list-table .button.btn-sm .dashicons { font-size: 16px; width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) {
  .nbd-modern-ui *, .nbd-modern-ui *::before, .nbd-modern-ui *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}

/* =========================================================
   TEMPLATE LIBRARY — shell scaffolding, skeleton, modal, lightbox
   (docs/spec/templates-dashboard.md §5–§9). All scoped to
   .nbd-modern-ui. JS (nbd-template-library.js) owns the markup;
   these rules only style it.
   ========================================================= */

/* ---- Section header + async shell regions ---- */
.nbd-modern-ui .nbd-tpl-section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--nbd-mb-text);
}
.nbd-modern-ui .nbd-tpl-section-count { font-size: 12px; font-weight: 400; color: var(--nbd-mb-text-soft); }

/* The load-more button carries .button, whose display:inline-flex would beat the
   UA [hidden] rule — re-hide it explicitly (id beats class on specificity). */
.nbd-modern-ui #nbd-tpl-more[hidden] { display: none; }

/* Empty / error state region (JS injects icon + copy + actions — spec §9). */
.nbd-modern-ui #nbd-tpl-state[hidden] { display: none; }
.nbd-modern-ui #nbd-tpl-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--nbd-mb-text-soft);
  font-size: 13px;
  line-height: 1.6;
}
.nbd-modern-ui #nbd-tpl-state .dashicons { font-size: 40px; width: 40px; height: 40px; color: var(--nbd-mb-text-mute); }
.nbd-modern-ui .nbd-tpl-state__title { margin: 10px 0 4px; font-size: 15px; font-weight: 600; color: var(--nbd-mb-text); }
.nbd-modern-ui .nbd-tpl-state__actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* ---- Loading skeleton (same footprint as a card) ---- */
.nbd-modern-ui .nbd-tpl-skeleton {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-xl);
  background: var(--nbd-mb-bg);
  overflow: hidden;
}
.nbd-modern-ui .nbd-tpl-skeleton__thumb { aspect-ratio: 4 / 3; }
.nbd-modern-ui .nbd-tpl-skeleton__body { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; }
.nbd-modern-ui .nbd-tpl-skeleton__line { height: 12px; border-radius: var(--nbd-radius-md); }
.nbd-modern-ui .nbd-tpl-skeleton__line--sm { width: 55%; height: 10px; }
.nbd-modern-ui .nbd-tpl-skeleton__line--btn { height: 30px; border-radius: var(--nbd-radius-xl); margin-top: 4px; }
.nbd-modern-ui .nbd-tpl-skeleton__thumb,
.nbd-modern-ui .nbd-tpl-skeleton__line {
  background: linear-gradient(90deg, var(--nbd-mb-bg-soft) 25%, var(--nbd-mb-bg) 50%, var(--nbd-mb-bg-soft) 75%);
  background-size: 400% 100%;
  animation: nbd-tpl-shimmer 1.4s ease infinite;
}
@keyframes nbd-tpl-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ---- Assign-to-products modal (spec §6) ---- */
.nbd-modern-ui .nbd-tpl-modal {
  position: fixed;
  inset: 0;
  z-index: 100000; /* above WP admin bar/menu */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.nbd-modern-ui .nbd-tpl-modal[hidden] { display: none; }
.nbd-modern-ui .nbd-tpl-modal__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55); }
.nbd-modern-ui .nbd-tpl-modal__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  background: var(--nbd-mb-bg);
  border-radius: var(--nbd-radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.nbd-modern-ui .nbd-tpl-modal__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--nbd-mb-border-light);
}
.nbd-modern-ui .nbd-tpl-modal__title { font-size: 15px; font-weight: 700; color: var(--nbd-mb-text); }
.nbd-modern-ui .nbd-tpl-modal__close {
  margin-left: auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--nbd-radius-sm);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--nbd-mb-text-mute);
  background: transparent;
}
.nbd-modern-ui .nbd-tpl-modal__close:hover { background: var(--nbd-mb-bg-soft); color: var(--nbd-mb-text); }
.nbd-modern-ui .nbd-tpl-modal__close:focus-visible { outline: 2px solid var(--pc-brand); outline-offset: 2px; }
.nbd-modern-ui .nbd-tpl-modal__body { padding: 14px 18px; overflow: auto; }
.nbd-modern-ui .nbd-tpl-modal__explain { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--nbd-mb-text-soft); }
.nbd-modern-ui .nbd-tpl-modal__list {
  border: 1px solid var(--nbd-mb-border-light);
  border-radius: var(--nbd-radius-lg);
  overflow: hidden;
}
.nbd-modern-ui .nbd-tpl-prod {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--nbd-mb-border-subtle);
  font-size: 13px;
  cursor: pointer;
}
.nbd-modern-ui .nbd-tpl-prod:last-child { border-bottom: 0; }
.nbd-modern-ui .nbd-tpl-prod:hover { background: var(--nbd-mb-bg-soft); }
.nbd-modern-ui .nbd-tpl-prod input[type="checkbox"] { flex: none; margin: 0; }
.nbd-modern-ui .nbd-tpl-prod__name { flex: 1; min-width: 0; font-weight: 500; color: var(--nbd-mb-text); }
.nbd-modern-ui .nbd-tpl-prod__cat { flex: none; font-size: 12px; color: var(--nbd-mb-text-mute); }
.nbd-modern-ui .nbd-tpl-prod__cat.is-change { color: var(--nbd-color-warning); } /* points at another collection → will be overwritten */
.nbd-modern-ui .nbd-tpl-modal__empty { padding: 24px 8px; text-align: center; font-size: 13px; color: var(--nbd-mb-text-soft); }
.nbd-modern-ui .nbd-tpl-modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--nbd-mb-border-light);
  background: var(--nbd-mb-bg-soft);
}

/* ---- Preview lightbox (spec §7) ---- */
.nbd-modern-ui .nbd-tpl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100010; /* above the assign modal */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
  background: rgba(15, 23, 42, 0.88);
}
.nbd-modern-ui .nbd-tpl-lightbox[hidden] { display: none; }
.nbd-modern-ui .nbd-tpl-lightbox__img {
  max-width: min(90vw, 1100px);
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--nbd-radius-md);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}
.nbd-modern-ui .nbd-tpl-lightbox__caption { max-width: 90vw; text-align: center; font-size: 14px; line-height: 1.5; color: #fff; }
.nbd-modern-ui .nbd-tpl-lightbox__cat { display: inline-block; margin-top: 4px; font-size: 12px; color: rgba(255, 255, 255, 0.7); }
.nbd-modern-ui .nbd-tpl-lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--nbd-radius-full);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}
.nbd-modern-ui .nbd-tpl-lightbox__close:hover { background: rgba(255, 255, 255, 0.28); }
.nbd-modern-ui .nbd-tpl-lightbox__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* =========================================================
   DESIGN RULES — SHARED COMPONENTS
   Reusable classes that encode the plugin's UI rules so every
   screen looks and behaves the same. Full guide + markup examples:
   docs/spec/ui-design-system.md
     R1  Page header carries a subtitle (.nbd-page-head-sub)
     R2  CTA = icon + title + note + button  (.nbd-cta)
     R3  Stat card = icon + label + value + note + CTA
     R4  Every field has a note            (.nbd-field-note / .description)
     R5  Coloured accents (.nbd-icon-chip variants, card-head tones)
   ========================================================= */

/* ---- R1: PAGE-HEAD SUBTITLE ----------------------------------
   Drop a .nbd-page-head-sub inside the page header (h1 / .nbd-page-head).
   It wraps to its own full-width line under the title thanks to the
   header's flex-wrap, in a lighter tone on the gradient. */
.nbd-modern-ui .wrap > h1 .nbd-page-head-sub,
.nbd-modern-ui .nbd-page-head .nbd-page-head-sub {
  flex-basis: 100%;
  margin: 2px 0 0;
  font-size: var(--nbd-text-base);
  font-weight: var(--nbd-weight-normal);
  line-height: var(--nbd-leading-normal);
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.85);
}

/* ---- R5: ICON CHIP (coloured) --------------------------------
   Small rounded square holding a dashicon. The single home for the
   32x32 chip pattern that stat cards used to inline. Tone via modifier. */
.nbd-modern-ui .nbd-icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--nbd-radius-xl);
  flex-shrink: 0;
  background: var(--nbd-primary-soft);
  color: var(--nbd-primary);
}
.nbd-modern-ui .nbd-icon-chip .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
  line-height: 1;
}
.nbd-modern-ui .nbd-icon-chip.is-info    { background: var(--nbd-color-info-soft);    color: var(--nbd-color-info); }
.nbd-modern-ui .nbd-icon-chip.is-success { background: var(--nbd-color-success-soft); color: var(--nbd-color-success); }
.nbd-modern-ui .nbd-icon-chip.is-warning { background: var(--nbd-color-warning-soft); color: var(--nbd-color-warning); }
.nbd-modern-ui .nbd-icon-chip.is-danger  { background: var(--nbd-color-error-soft);   color: var(--nbd-color-error); }
.nbd-modern-ui .nbd-icon-chip.is-violet  { background: var(--nbd-color-violet-soft);  color: var(--nbd-color-violet); }
.nbd-modern-ui .nbd-icon-chip.is-lg { width: 44px; height: 44px; border-radius: 10px; }
.nbd-modern-ui .nbd-icon-chip.is-lg .dashicons { font-size: 24px; width: 24px; height: 24px; }

/* ---- R2: CTA BLOCK -------------------------------------------
   Rule: a call-to-action always pairs an explanatory note with a clear
   button — never a naked button, never a note with no next step.
   Layout: [icon] [title + note] .......... [button]
   <div class="nbd-cta is-brand">
     <span class="nbd-icon-chip is-info"><span class="dashicons dashicons-...">…</span>
     <div class="nbd-cta-body">
       <p class="nbd-cta-title">Do the thing</p>
       <p class="nbd-cta-note">Why it matters, in one plain sentence.</p>
     </div>
     <a class="button button-primary nbd-cta-action">Do it</a>
   </div> */
.nbd-modern-ui .nbd-cta {
  display: flex;
  align-items: center;
  gap: var(--nbd-space-4);
  padding: var(--nbd-space-4) var(--nbd-space-5);
  margin-bottom: var(--nbd-space-4);
  background: var(--nbd-mb-bg);
  border: 1px solid var(--nbd-mb-border-light);
  border-left: 4px solid var(--nbd-primary);
  border-radius: var(--nbd-radius-lg);
  box-shadow: var(--nbd-shadow-sm);
}
.nbd-modern-ui .nbd-cta-body { flex: 1; min-width: 0; }
.nbd-modern-ui .nbd-cta .nbd-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--nbd-space-2);
  margin: 0 0 5px;
}
.nbd-modern-ui .nbd-cta-title {
  margin: 0;
  font-size: var(--nbd-text-md);
  font-weight: var(--nbd-weight-semibold);
  color: var(--nbd-mb-text);
  line-height: var(--nbd-leading-tight);
}
.nbd-modern-ui .nbd-cta-note {
  margin: 3px 0 0;
  font-size: var(--nbd-text-sm);
  color: var(--nbd-mb-text-soft);
  line-height: var(--nbd-leading-normal);
}
.nbd-modern-ui .nbd-cta-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--nbd-space-2);
  flex: none;
}
.nbd-modern-ui .nbd-cta-action { flex: none; align-self: center; white-space: nowrap; }
.nbd-modern-ui .nbd-cta-secondary {
  color: var(--pc-brand);
  font-size: var(--nbd-text-sm);
  font-weight: var(--nbd-weight-semibold);
  text-decoration: none;
  white-space: nowrap;
}
.nbd-modern-ui .nbd-cta-secondary:hover,
.nbd-modern-ui .nbd-cta-secondary:focus {
  color: var(--pc-brand-press, #1d4ed8);
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* Tonal CTAs — soft tinted background + matching accent rail. */
.nbd-modern-ui .nbd-cta.is-brand   { background: var(--nbd-primary-tint);        border-left-color: var(--nbd-primary); }
.nbd-modern-ui .nbd-cta.is-success { background: var(--nbd-tint-success);        border-left-color: var(--nbd-color-success); }
.nbd-modern-ui .nbd-cta.is-warning { background: var(--nbd-tint-warning);        border-left-color: var(--nbd-color-warning); }
.nbd-modern-ui .nbd-cta.is-danger  { background: var(--nbd-color-error-soft);    border-left-color: var(--nbd-color-error); }
.nbd-modern-ui .nbd-cta.is-violet  { background: var(--nbd-tint-violet);         border-left-color: var(--nbd-color-violet); }
@media (max-width: 782px) {
  .nbd-modern-ui .nbd-cta { flex-wrap: wrap; }
  .nbd-modern-ui .nbd-cta-actions { align-items: stretch; width: 100%; }
  .nbd-modern-ui .nbd-cta-action { justify-content: center; width: 100%; }
  .nbd-modern-ui .nbd-cta-secondary { text-align: center; }
}

/* ---- R3: STAT CARD — note + CTA are part of the pattern -------
   Base .nbd-stat-card styling lives in the STAT/SUMMARY section above;
   here we add the inner structure so views stop inlining it and every
   metric ships a one-line note and a button to the matching screen.
   <div class="nbd-stat-card is-info">
     <div class="nbd-stat-head">
       <span class="nbd-icon-chip is-info"><span class="dashicons ...">…</span>
       <span class="nbd-stat-label">Revenue (30d)</span>
     </div>
     <div class="nbd-stat-value">$6,900</div>
     <p class="nbd-stat-note">Across 4 paid orders this month.</p>
     <a class="btn nbd-stat-cta" href="…">View orders</a>
   </div> */
.nbd-modern-ui .nbd-stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--nbd-space-2);
}
.nbd-modern-ui .nbd-stat-head { display: flex; align-items: center; gap: 10px; }
.nbd-modern-ui .nbd-stat-note {
  margin: 0;
  font-size: var(--nbd-text-sm);
  color: var(--nbd-mb-text-soft);
  line-height: var(--nbd-leading-normal);
}
.nbd-modern-ui .nbd-stat-cta { margin-top: auto; align-self: flex-start; }
/* Soft tinted backgrounds keyed to the accent, so the grid isn't four grey boxes. */
.nbd-modern-ui .nbd-stat-card.is-info    { background: var(--nbd-tint-info); }
.nbd-modern-ui .nbd-stat-card.is-success,
.nbd-modern-ui .nbd-stat-card.success    { background: var(--nbd-tint-success); }
.nbd-modern-ui .nbd-stat-card.is-warning,
.nbd-modern-ui .nbd-stat-card.warning    { background: var(--nbd-tint-warning); }
.nbd-modern-ui .nbd-stat-card.is-violet  { background: var(--nbd-tint-violet); }
/* Left accent bar colour for the .is-* variants (legacy .success/.warning/.danger
   already carry theirs from the STAT/SUMMARY section above). Base bar = brand blue,
   so .is-info needs no override. */
.nbd-modern-ui .nbd-stat-card.is-success::before { background: var(--nbd-color-success); }
.nbd-modern-ui .nbd-stat-card.is-warning::before { background: var(--nbd-color-warning); }
.nbd-modern-ui .nbd-stat-card.is-danger::before  { background: var(--nbd-color-error); }
.nbd-modern-ui .nbd-stat-card.is-violet::before  { background: var(--nbd-color-violet); }

.nbd-modern-ui .nbd-sample-data-cta {
  display: flex;
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-color: #dc2626;
  box-shadow: inset 4px 0 0 #dc2626, var(--nbd-shadow-sm, 0 1px 2px rgba(0,0,0,.06));
  width: 100%;
}
.nbd-modern-ui .nbd-sample-data-cta:hover,
.nbd-modern-ui .nbd-sample-data-cta:focus-within {
  border-color: #dc2626;
  box-shadow: inset 4px 0 0 #dc2626, var(--nbd-shadow-md, 0 6px 14px rgba(0,0,0,.08));
}
.nbd-modern-ui .nbd-sample-data-cta h3 {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.3;
}
.nbd-modern-ui .nbd-sample-data-cta p {
  max-width: 720px;
  margin: 0;
  color: var(--nbd-mb-text-soft, #6b7280);
  font-size: 13px;
  line-height: 1.45;
}
.nbd-modern-ui .nbd-sample-data-cta .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
@media (max-width: 782px) {
  .nbd-modern-ui .nbd-sample-data-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---- R4: FIELD NOTE ------------------------------------------
   Rule: every form control gets a short note explaining what it does.
   Styles both the WP-native .description and the new .nbd-field-note the
   same way, so old and new markup read identically. */
.nbd-modern-ui .form-table td .description,
.nbd-modern-ui .form-table td p.description,
.nbd-modern-ui .nbd-field-note {
  display: block;
  margin: 6px 0 0;
  font-size: var(--nbd-text-sm);
  font-style: normal;
  color: var(--nbd-mb-text-soft);
  line-height: var(--nbd-leading-normal);
}
/* Optional leading hint icon for a field note. */
.nbd-modern-ui .nbd-field-note .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 3px;
  color: var(--nbd-mb-text-mute);
}

/* ---- Card head subtitle (section descriptions) ---------------
   Rule: a card/section header explains itself in a sub-line, not just a
   terse title. Stack title + sub in a text wrapper and flag the head:
   <div class="nbd-card-head is-brand has-sub">
     <span class="dashicons dashicons-...">
     <div class="nbd-card-head-text">
       <span class="nbd-card-head-title">Printing options</span>
       <span class="nbd-card-head-sub">Sizes, materials and prices buyers pick from.</span>
     </div>
   </div> */
.nbd-modern-ui .nbd-card-head.has-sub { align-items: flex-start; }
.nbd-modern-ui .nbd-card-head-text { display: flex; flex-direction: column; min-width: 0; }
.nbd-modern-ui .nbd-card-head-title { line-height: var(--nbd-leading-tight); }
.nbd-modern-ui .nbd-card-head-sub {
  margin: 2px 0 0;
  font-size: var(--nbd-text-sm);
  font-weight: var(--nbd-weight-normal);
  color: var(--nbd-mb-text-soft);
  line-height: var(--nbd-leading-normal);
}

/* =========================================================
   DASHBOARD PRIMITIVES
   Reusable list / footer / chip-size / metric pieces that the
   dashboard views (Overview, Files, Orders, License…) inlined
   over and over. Adding the class replaces the inline style 1:1.
   See docs/spec/ui-design-system.md §4.
   ========================================================= */

/* ---- Icon chip — small (28px) variant, pairs with .nbd-icon-chip ---- */
.nbd-modern-ui .nbd-icon-chip.is-sm { width: 28px; height: 28px; border-radius: var(--nbd-radius-lg); }
.nbd-modern-ui .nbd-icon-chip.is-sm .dashicons { font-size: 16px; width: 16px; height: 16px; }

/* ---- Thumbnail size variants (base .nbd-thumb = 40px) ---- */
.nbd-modern-ui .nbd-thumb.is-sm { width: 34px; height: 34px; }
.nbd-modern-ui .nbd-thumb.is-lg { width: 52px; height: 52px; }

/* ---- List rows (activity feed, recent items, quick actions, client list) ----
   <ul class="nbd-list is-divided">
     <li class="nbd-list-row"> … flex row of [chip] [body] [meta/link] … </li>
   </ul>
   Replaces the repeated `display:flex;align-items:center;gap:10px;padding:8px 16px`. */
.nbd-modern-ui .nbd-list { margin: 0; padding: 0; list-style: none; }
.nbd-modern-ui .nbd-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--nbd-space-2) var(--nbd-space-4);
  color: var(--nbd-mb-text);
}
.nbd-modern-ui .nbd-list-row > .nbd-list-body { min-width: 0; flex: 1; }
.nbd-modern-ui .nbd-list-row .nbd-list-title {
  font-weight: var(--nbd-weight-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nbd-modern-ui .nbd-list-row .nbd-list-meta { font-size: var(--nbd-text-sm); color: var(--nbd-mb-text-mute); }
.nbd-modern-ui .nbd-list.is-divided .nbd-list-row + .nbd-list-row { border-top: 1px solid var(--nbd-mb-border-subtle); }
.nbd-modern-ui .nbd-list-row.is-hoverable:hover { background: var(--nbd-mb-bg-soft); }

/* ---- Card footer link bar (the "View all →" strip at the bottom of a card) ----
   Replaces `padding:10px 16px;border-top:1px solid var(--nbd-mb-border-subtle)`. */
.nbd-modern-ui .nbd-card-foot {
  padding: 10px var(--nbd-space-4);
  border-top: 1px solid var(--nbd-mb-border-subtle);
  font-size: var(--nbd-text-base);
}

/* ---- Mini metric group (small value + label trios, e.g. Clients summary) ---- */
.nbd-modern-ui .nbd-mini-metrics { display: flex; gap: var(--nbd-space-2); }
.nbd-modern-ui .nbd-mini-metric { flex: 1; }
.nbd-modern-ui .nbd-mini-metric-value {
  font-size: 20px;
  font-weight: var(--nbd-weight-bold);
  color: var(--nbd-mb-text);
  line-height: var(--nbd-leading-tight);
  font-variant-numeric: tabular-nums;
}
.nbd-modern-ui .nbd-mini-metric-label { font-size: var(--nbd-text-xs); color: var(--nbd-mb-text-soft); }

/* ---- Eyebrow / tag label (10-11px uppercase, e.g. alert type, "NEW") ---- */
.nbd-modern-ui .nbd-eyebrow {
  font-size: var(--nbd-text-xs);
  font-weight: var(--nbd-weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--nbd-mb-text-mute);
}
/* Soft/larger eyebrow — for section labels that should read as headers, not
   micro-meta (13px + softer grey). Lossless swap for the old inline label. */
.nbd-modern-ui .nbd-eyebrow.is-soft {
  font-size: var(--nbd-text-base);
  color: var(--nbd-mb-text-soft);
}

/* =========================================================
   POLISH-PASS PRIMITIVES
   Closes the gaps the page-refactor agents reported: a context-free
   caption class, a round icon chip + text avatar for feeds/people,
   a filter chip, and a full-width button. See ui-design-system.md §4.
   ========================================================= */

/* ---- Caption / meta text usable ANYWHERE (not only in list rows / forms).
   Replaces the repeated inline `font-size:12px;color:var(--nbd-mb-text-soft)`. */
.nbd-modern-ui .nbd-meta {
  font-size: var(--nbd-text-sm);
  color: var(--nbd-mb-text-soft);
  line-height: var(--nbd-leading-normal);
}
.nbd-modern-ui .nbd-meta.is-mute { color: var(--nbd-mb-text-mute); }

/* ---- Round icon chip (activity feeds). Round + neutral bg; the inner
   dashicon keeps whatever colour the markup sets (often per-event/dynamic),
   so pair with .is-neutral and let an inline colour on the glyph win. */
.nbd-modern-ui .nbd-icon-chip.is-round { border-radius: var(--nbd-radius-full); }
.nbd-modern-ui .nbd-icon-chip.is-neutral { background: var(--nbd-mb-bg-soft); color: var(--nbd-mb-text-soft); }

/* ---- Text / initials avatar (people: clients, customers) ---- */
.nbd-modern-ui .nbd-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--nbd-radius-full);
  flex-shrink: 0;
  background: var(--nbd-primary-soft);
  color: var(--nbd-primary);
  font-size: var(--nbd-text-base);
  font-weight: var(--nbd-weight-semibold);
  line-height: 1;
  text-transform: uppercase;
}
.nbd-modern-ui .nbd-avatar.is-sm { width: 28px; height: 28px; font-size: var(--nbd-text-sm); }
.nbd-modern-ui .nbd-avatar.is-lg { width: 44px; height: 44px; font-size: var(--nbd-text-lg); }

/* ---- Filter chip (toggle pills in list toolbars). Unlike .nbd-pill (a static
   status badge with a .dot), this is an interactive filter with an active state. */
.nbd-modern-ui .nbd-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--nbd-radius-full);
  border: 1px solid var(--nbd-mb-border-light);
  background: var(--nbd-mb-bg);
  font-size: var(--nbd-text-sm);
  font-weight: var(--nbd-weight-semibold);
  color: var(--nbd-mb-text-soft);
  transition: background var(--nbd-duration-fast), border-color var(--nbd-duration-fast), color var(--nbd-duration-fast);
}
.nbd-modern-ui .nbd-chip:hover { border-color: var(--nbd-primary); color: var(--nbd-primary); }
.nbd-modern-ui .nbd-chip.is-active {
  background: var(--nbd-primary-soft);
  border-color: var(--nbd-primary);
  color: var(--nbd-primary);
}

/* ---- Full-width button (form footers, card CTAs on narrow columns) ---- */
.nbd-modern-ui .btn-block { display: flex; width: 100%; }

/* =========================================================
   ACTION LIST  (Quick actions / shortcut cards)
   Upgrades the old bare "-> link" lists into rows that each carry an
   icon + a title + a one-line description of what the action does.
   <div class="nbd-action-list">
     <a class="nbd-action-item" href="...">
       <span class="nbd-action-icon"><span class="dashicons dashicons-..."></span></span>
       <span class="nbd-action-text">
         <span class="nbd-action-title">Configure designer & print options</span>
         <span class="nbd-action-desc">Sides, pricing and print-ready output.</span>
       </span>
       <span class="nbd-action-arrow dashicons dashicons-arrow-right-alt2"></span>
     </a>
   </div>
   See docs/spec/ui-design-system.md §4.
   ========================================================= */
.nbd-modern-ui .nbd-action-list { display: flex; flex-direction: column; }
.nbd-modern-ui .nbd-action-item {
  display: flex;
  align-items: center;
  gap: var(--nbd-space-3);
  padding: 10px var(--nbd-space-4);
  color: var(--nbd-mb-text);
  text-decoration: none;
  border-radius: var(--nbd-radius-md);
  transition: background var(--nbd-duration-fast);
}
.nbd-modern-ui .nbd-action-item + .nbd-action-item { border-top: 1px solid var(--nbd-mb-border-subtle); }
.nbd-modern-ui .nbd-action-item:hover { background: var(--nbd-primary-tint); }
.nbd-modern-ui .nbd-action-item:hover .nbd-action-title { color: var(--nbd-primary); }
/* Icon holder — reuses the chip look; tone via .is-* like .nbd-icon-chip. */
.nbd-modern-ui .nbd-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--nbd-radius-lg);
  background: var(--nbd-primary-soft);
  color: var(--nbd-primary);
}
.nbd-modern-ui .nbd-action-icon .dashicons { font-size: 18px; width: 18px; height: 18px; line-height: 1; }
.nbd-modern-ui .nbd-action-icon.is-success { background: var(--nbd-color-success-soft); color: var(--nbd-color-success); }
.nbd-modern-ui .nbd-action-icon.is-warning { background: var(--nbd-color-warning-soft); color: var(--nbd-color-warning); }
.nbd-modern-ui .nbd-action-icon.is-violet  { background: var(--nbd-color-violet-soft);  color: var(--nbd-color-violet); }
.nbd-modern-ui .nbd-action-icon.is-neutral { background: var(--nbd-mb-bg-soft);         color: var(--nbd-mb-text-soft); }
.nbd-modern-ui .nbd-action-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nbd-modern-ui .nbd-action-title { font-weight: var(--nbd-weight-semibold); line-height: var(--nbd-leading-tight); }
.nbd-modern-ui .nbd-action-desc {
  font-size: var(--nbd-text-sm);
  color: var(--nbd-mb-text-soft);
  line-height: var(--nbd-leading-normal);
  margin-top: 1px;
}
.nbd-modern-ui .nbd-action-arrow {
  flex-shrink: 0;
  color: var(--nbd-mb-text-mute);
  font-size: 18px;
  width: 18px;
  height: 18px;
  transition: transform var(--nbd-duration-fast), color var(--nbd-duration-fast);
}
.nbd-modern-ui .nbd-action-item:hover .nbd-action-arrow { color: var(--nbd-primary); transform: translateX(2px); }

/* =========================================================
   KEY-VALUE TABLE + BREADCRUMB  (detail-page primitives)
   Both recur across the detail views (file / order / client) and were
   inlined row-by-row. See docs/spec/ui-design-system.md §4.
   ========================================================= */

/* Metadata table: left cell = muted label, right cell = value, right-aligned.
   <table class="nbd-kv"><tr><td>Label</td><td>Value</td></tr>…</table> */
.nbd-modern-ui .nbd-kv {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--nbd-text-base);
}
.nbd-modern-ui .nbd-kv th,
.nbd-modern-ui .nbd-kv td { padding: var(--nbd-space-1) 0; vertical-align: top; }
.nbd-modern-ui .nbd-kv th {
  color: var(--nbd-mb-text-soft);
  font-weight: var(--nbd-weight-normal);
  text-align: left;
  white-space: nowrap;
  padding-right: var(--nbd-space-3);
}
.nbd-modern-ui .nbd-kv td:last-child { text-align: right; color: var(--nbd-mb-text); }
.nbd-modern-ui .nbd-kv tr + tr th,
.nbd-modern-ui .nbd-kv tr + tr td { border-top: 1px solid var(--nbd-mb-border-subtle); }

/* Breadcrumb: "Parent / current · meta". Use .sep for the separators and
   .nbd-breadcrumb-meta for the trailing muted context. */
.nbd-modern-ui .nbd-breadcrumb {
  margin: var(--nbd-space-1) 0 14px;
  font-size: var(--nbd-text-base);
  line-height: var(--nbd-leading-normal);
}
.nbd-modern-ui .nbd-breadcrumb .sep,
.nbd-modern-ui .nbd-breadcrumb-meta { color: var(--nbd-mb-text-soft); }
.nbd-modern-ui .nbd-breadcrumb a { text-decoration: none; }
.nbd-modern-ui .nbd-breadcrumb a:hover { text-decoration: underline; }

/* ── AI Preflight panel contract (.nbd-pf-*) ───────────────────────────────
   Shared by the WooCommerce order metabox, the Files > File detail screen and
   the live JS re-render in includes/class.printcart.ai.php. Kept UNSCOPED (not
   under .nbd-modern-ui) so the same class hooks style identically on the plain
   WooCommerce order-edit screen too. The metabox script also prints these base
   rules inline, so the Auto-fix menu hides correctly even without this file. */
.nbd-pf-rows { margin-top: 2px; }
.nbd-pf-row {
  display: flex;
  gap: 6px;
  align-items: baseline;
  padding: 3px 0;
}
.nbd-pf-icon { flex: 0 0 auto; }
.nbd-pf-row.is-pass .nbd-pf-icon { color: #1a7f37; }
.nbd-pf-row.is-warn .nbd-pf-icon { color: #e08a1e; }
.nbd-pf-row.is-fail .nbd-pf-icon { color: #b32d2e; }
.nbd-pf-text { flex: 1 1 auto; }
.nbd-pf-label { font-weight: var(--nbd-weight-semibold, 600); }
.nbd-pf-msg { color: var(--nbd-mb-text-soft, #646970); }

/* Order/File shared AI Preflight panel. */
.nbd-modern-ui .nbd-order-ai .nbd-card-head.is-brand,
.nbd-modern-ui .nbd-file-ai .nbd-card-head.is-brand {
  background: var(--pc-brand-gradient);
  border-bottom-color: rgba(255,255,255,0.18);
  color: #fff;
}
.nbd-modern-ui .nbd-order-ai .nbd-card-head.is-brand .nbd-card-head-title,
.nbd-modern-ui .nbd-order-ai .nbd-card-head.is-brand .nbd-card-head-sub,
.nbd-modern-ui .nbd-order-ai .nbd-card-head.is-brand .dashicons,
.nbd-modern-ui .nbd-file-ai .nbd-card-head.is-brand .nbd-card-head-title,
.nbd-modern-ui .nbd-file-ai .nbd-card-head.is-brand .nbd-card-head-sub,
.nbd-modern-ui .nbd-file-ai .nbd-card-head.is-brand .dashicons {
  color: #fff;
}
.nbd-modern-ui .nbd-order-ai .nbd-card-head.is-brand .nbd-pill,
.nbd-modern-ui .nbd-file-ai .nbd-card-head.is-brand .nbd-pill {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.32);
  color: #fff;
}
.nbd-modern-ui .nbd-ai-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--nbd-space-3);
  align-items: center;
  margin-bottom: var(--nbd-space-3);
  padding: var(--nbd-space-3);
  border: 1px solid var(--nbd-mb-border-light);
  border-left: 4px solid var(--nbd-color-info);
  border-radius: var(--nbd-radius-md);
  background: #ecfeff;
}
.nbd-modern-ui .nbd-ai-summary.is-success { background:#ecfdf5; border-color:#86efac; border-left-color:var(--nbd-color-success); }
.nbd-modern-ui .nbd-ai-summary.is-warning { background:#fffbeb; border-color:#facc15; border-left-color:var(--nbd-color-warning); }
.nbd-modern-ui .nbd-ai-summary.is-danger  { background:#fef2f2; border-color:#fca5a5; border-left-color:var(--nbd-color-error); }
.nbd-modern-ui .nbd-ai-summary-main {
  display: flex;
  gap: var(--nbd-space-3);
  align-items: flex-start;
  min-width: 0;
}
.nbd-modern-ui .nbd-ai-summary-main > .dashicons {
  flex: none;
  width: 22px;
  height: 22px;
  font-size: 22px;
  color: var(--nbd-color-info);
}
.nbd-modern-ui .nbd-ai-summary.is-success .nbd-ai-summary-main > .dashicons { color: var(--nbd-color-success); }
.nbd-modern-ui .nbd-ai-summary.is-warning .nbd-ai-summary-main > .dashicons { color: var(--nbd-color-warning); }
.nbd-modern-ui .nbd-ai-summary.is-danger .nbd-ai-summary-main > .dashicons { color: var(--nbd-color-error); }
.nbd-modern-ui .nbd-ai-summary strong { display: block; color: var(--nbd-mb-text); line-height: var(--nbd-leading-tight); }
.nbd-modern-ui .nbd-ai-summary p { margin: 3px 0 0; color: var(--nbd-mb-text-soft); }
.nbd-modern-ui .nbd-ai-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nbd-space-2);
  justify-content: flex-end;
  align-items: center;
}
.nbd-modern-ui .nbd-ai-token-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--pc-brand-soft);
  border-radius: var(--nbd-radius-xl);
  background: #fff;
  color: var(--pc-brand);
  font-size: var(--nbd-text-sm);
  font-weight: var(--nbd-weight-semibold);
}
.nbd-modern-ui .nbd-ai-pdf-item {
  padding: var(--nbd-space-3);
  border: 1px solid var(--nbd-mb-border-light);
  border-left: 4px solid var(--nbd-color-info);
  border-radius: var(--nbd-radius-md);
  background: var(--nbd-mb-bg);
}
.nbd-modern-ui .nbd-ai-pdf-item + .nbd-ai-pdf-item { margin-top: var(--nbd-space-3); }
.nbd-modern-ui .nbd-ai-pdf-item.is-ready { border-left-color: var(--nbd-color-success); }
.nbd-modern-ui .nbd-ai-pdf-item.is-needs_fix,
.nbd-modern-ui .nbd-ai-pdf-item.is-failed { border-left-color: var(--nbd-color-error); }
.nbd-modern-ui .nbd-ai-pdf-item.is-not_checked,
.nbd-modern-ui .nbd-ai-pdf-item.is-low_dpi,
.nbd-modern-ui .nbd-ai-pdf-item.is-no_pdf { border-left-color: var(--nbd-color-warning); }
.nbd-modern-ui .nbd-ai-pdf-top {
  display: flex;
  justify-content: space-between;
  gap: var(--nbd-space-3);
  margin-bottom: var(--nbd-space-2);
}
.nbd-modern-ui .nbd-ai-pdf-name {
  color: var(--nbd-mb-text);
  font-weight: var(--nbd-weight-semibold);
  line-height: var(--nbd-leading-tight);
}
.nbd-modern-ui .nbd-ai-pdf-meta {
  margin-top: 3px;
  color: var(--nbd-mb-text-soft);
  font-size: var(--nbd-text-sm);
}
.nbd-modern-ui .nbd-ai-status { margin-bottom: var(--nbd-space-2) !important; }
.nbd-modern-ui .nbd-ai-pdf-result { font-size: var(--nbd-text-sm) !important; }
.nbd-modern-ui .nbd-ai-pdf-actions {
  margin-top: var(--nbd-space-2) !important;
  display: flex !important;
  flex-wrap: wrap;
  gap: var(--nbd-space-2) !important;
  align-items: center;
}
.nbd-modern-ui .nbd-ai-banner {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--nbd-radius-md);
  font-weight: var(--nbd-weight-semibold);
  margin-bottom: 8px;
  line-height: var(--nbd-leading-normal);
}
.nbd-modern-ui .nbd-ai-banner.is-ok { background:#ecfdf5; border:1px solid #86efac; color:#166534; }
.nbd-modern-ui .nbd-ai-banner.is-warn { background:#fffbeb; border:1px solid #facc15; color:#854d0e; }
.nbd-modern-ui .nbd-ai-banner.is-err { background:#fef2f2; border:1px solid #fca5a5; color:#991b1b; }

@media (max-width: 782px) {
  .nbd-modern-ui .nbd-ai-summary {
    grid-template-columns: 1fr;
  }
  .nbd-modern-ui .nbd-ai-summary-actions {
    justify-content: stretch;
  }
  .nbd-modern-ui .nbd-ai-summary-actions .button,
  .nbd-modern-ui .nbd-ai-token-chip {
    justify-content: center;
    width: 100%;
  }
}

/* Auto-fix dropdown — hidden by default, revealed by the .open class the panel
   JS toggles (never inline display, so the class always wins). */
.nbd-pf-autofix {
  position: relative;
  display: inline-block;
  margin-top: 8px;
}
.nbd-pf-autofix-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 20;
  min-width: 210px;
  margin-top: 4px;
  padding: 4px 0;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .14);
}
.nbd-pf-autofix-menu.open { display: block; }
.nbd-pf-autofix-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
  color: #1d2327;
}
.nbd-pf-autofix-item:hover { background: #f0f0f1; }
.nbd-pf-autofix-item[disabled] { opacity: .5; cursor: default; }
