/* PDL overrides on Metronic 9 Tailwind — uses templates/colors/pdl-colors.css only */
@import url("../../../colors/pdl-colors.css");

:root {
  --pdl-font: "Inter", system-ui, -apple-system, sans-serif;
  /* Action icon scale — change this one value to resize table/toolbar action glyphs site-wide */
  --pdl-action-icon-size: 1.5rem;
  --pdl-action-slot-size: 2rem;
  /* PDL data table headers — shared across .pdl-dt-table and kt-table listings */
  --pdl-dt-th-font-size: 0.9375rem;
  --pdl-dt-th-font-weight: 700;
  --pdl-dt-th-color: var(--pdl-color-text, #1e293b);
  --pdl-dt-th-bg: var(--pdl-color-surface-soft, #f8fafc);
  --pdl-dt-th-border: var(--pdl-color-border-soft, #e2e8f0);
  --pdl-dt-th-padding-y: 0.75rem;
  --pdl-dt-th-padding-x: 0.75rem;
}

:root,
[data-kt-theme="true"],
[data-kt-theme-mode="light"] {
  --primary: var(--pdl-color-brand);
  --color-primary: var(--pdl-color-brand);
  --ring-color: color-mix(in srgb, var(--pdl-color-brand) 35%, transparent);
}

[data-kt-theme-mode="dark"] {
  --primary: var(--pdl-color-brand-soft);
  --color-primary: var(--pdl-color-brand-soft);
}

/* Sidebar Metronic kt-menu (PDL brand colors) */
#sidebar {
  --pdl-menu-text: var(--pdl-color-text);
  --pdl-menu-text-muted: var(--pdl-color-muted);
  --pdl-menu-hover-bg: var(--pdl-color-brand-hover-soft);
  --pdl-menu-active-bg: var(--pdl-color-selection-bg);
  --pdl-menu-active-text: var(--pdl-color-selection-text);
  --pdl-menu-open-bg: var(--pdl-color-surface-soft);
}

#sidebar .topbar-item,
#sidebar_menu > .topbar-item {
  display: none !important;
}

/* Top-right account menu (main content column) */
.pdl-profile-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
}

.pdl-profile-topbar__trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--pdl-color-brand) 45%, transparent);
  outline-offset: 2px;
}

.pdl-profile-topbar__dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.35rem;
  min-width: 260px;
  padding: 0.5rem 0;
  background: var(--pdl-color-surface, #fff);
  border: 1px solid var(--pdl-color-border);
  border-radius: 0.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  z-index: 1050;
}

[data-pdl-profile-menu].is-open .pdl-profile-topbar__dropdown,
.pdl-profile-topbar.is-open .pdl-profile-topbar__dropdown {
  display: block;
}

.pdl-profile-user {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.5rem;
  max-width: 100%;
}

.pdl-profile-greeting {
  line-height: 1.25;
  min-width: 0;
  max-width: min(14rem, 40vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdl-profile-topbar__trigger {
  flex-shrink: 0;
}

.pdl-profile-topbar__avatar {
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  flex-shrink: 0;
  border-radius: 50%;
  box-sizing: border-box;
}

.pdl-profile-topbar__avatar--img {
  display: block;
  object-fit: cover;
  border: 1px solid var(--pdl-color-border, #e5e7eb);
}

.pdl-profile-topbar__avatar--initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pdl-color-brand-dark, #5b21b6);
  background: color-mix(in srgb, var(--pdl-color-brand, #7c3aed) 12%, #fff);
  border: 1px solid var(--pdl-color-border, #e5e7eb);
}

.pdl-page-header-bar {
  overflow: visible;
}

.pdl-page-header-bar__user {
  overflow: visible;
  flex-shrink: 0;
}

#pdl-global-user-bar {
  overflow: visible;
}

#pdl-global-user-bar .pdl-profile-user {
  margin-left: auto;
}

.pdl-profile-topbar__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--pdl-color-text);
  text-decoration: none;
}

.pdl-profile-topbar__item:hover {
  background: var(--pdl-color-brand-hover-soft, rgba(0, 0, 0, 0.04));
  color: var(--pdl-color-text);
  text-decoration: none;
}

.pdl-profile-topbar__item--danger,
.pdl-profile-topbar__item--danger:hover {
  color: var(--pdl-color-danger, #b42318);
}

.pdl-profile-topbar__separator {
  margin: 0.35rem 0;
  border-top: 1px solid var(--pdl-color-border);
}

.pdl-profile-topbar__roles {
  padding: 0.35rem 1rem 0.5rem;
}

.pdl-profile-topbar__roles-title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pdl-color-text-muted, #6b7280);
  margin-bottom: 0.35rem;
}

.pdl-profile-topbar__roles-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pdl-profile-topbar__roles-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.8125rem;
  color: var(--pdl-color-text);
}

.pdl-profile-topbar__roles-item.is-developer .pdl-profile-topbar__roles-label {
  font-weight: 600;
}

.pdl-profile-topbar__roles-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pdl-color-brand, #7c3aed) 14%, #fff);
  color: var(--pdl-color-brand-dark, #5b21b6);
  white-space: nowrap;
}

.pdl-profile-topbar__clone {
  padding: 0.35rem 0 0.15rem;
}

.pdl-profile-topbar__clone-title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pdl-color-text-muted, #6b7280);
  padding: 0 1rem 0.25rem;
}

.pdl-profile-topbar__item--button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.pdl-profile-topbar__item--clone-last .pdl-profile-topbar__clone-last-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.pdl-clone-modal .kt-modal-content.pdl-clone-modal__content {
  width: min(20rem, calc(100vw - 2rem));
  max-width: 20rem;
  margin-inline: auto;
}

.pdl-clone-modal .pdl-clone-modal__header {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.pdl-clone-modal .kt-modal-title {
  font-size: 0.9375rem;
  font-weight: 600;
}

.pdl-clone-modal .pdl-clone-modal__body {
  padding: 0.75rem 0.875rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pdl-clone-modal .pdl-clone-modal__body .pdl-label-picker {
  margin: 0;
}

.pdl-clone-modal .pdl-clone-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.pdl-profile-user .pdl-profile-topbar__dropdown {
  right: 0;
  top: calc(100% + 0.35rem);
}

/* Pages with header_bar: hide duplicate global user strip above main */
.kt-wrapper:has(#content .pdl-page-header-bar) #pdl-global-user-bar {
  display: none !important;
}

/* Profile photo page */
.pdl-profile-photo-page {
  max-width: 28rem;
  margin: 0 auto;
}

.pdl-profile-photo-current {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.pdl-profile-photo-current__frame {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--pdl-color-border);
  background: var(--pdl-color-surface-soft, #f4f6f8);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.pdl-profile-photo-current__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdl-profile-photo-current__placeholder {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--pdl-color-brand);
}

.pdl-profile-photo-current__label {
  font-size: 0.8125rem;
  color: var(--pdl-color-muted);
}

.pdl-profile-photo-editor {
  text-align: center;
}

.pdl-photo-crop__pick-row {
  margin-bottom: 1rem;
}

.pdl-photo-crop__workspace-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--pdl-color-text);
  margin: 0 0 0.75rem;
}

.pdl-photo-crop__pick.kt-btn-primary {
  color: #fff !important;
  background-color: var(--pdl-color-brand) !important;
  border-color: var(--pdl-color-brand) !important;
  min-height: 2.75rem;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.pdl-photo-crop__pick.kt-btn-primary:hover {
  filter: brightness(0.95);
}

.pdl-photo-crop__pick span {
  position: relative;
  z-index: 1;
  pointer-events: none;
  font-weight: 600;
}

.pdl-photo-crop__stage-wrap {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 1rem;
  background: transparent;
}

.pdl-photo-crop__stage {
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  overflow: hidden;
  cursor: grab;
  background: transparent;
  touch-action: none;
  isolation: isolate;
}

.pdl-profile-photo-page.is-dragging .pdl-photo-crop__stage {
  cursor: grabbing;
}

.pdl-photo-crop__img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  user-select: none;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
}

.pdl-photo-crop__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--pdl-color-brand) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--pdl-color-border) 80%, transparent);
  pointer-events: none;
  z-index: 2;
}

.pdl-photo-crop__hint {
  text-align: center;
  margin: 0 0 0.75rem;
}

.pdl-photo-crop__controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 0.5rem;
}

.pdl-photo-crop__zoom {
  width: 100%;
  accent-color: var(--pdl-color-brand);
}

.pdl-photo-crop__submit {
  width: 100%;
  min-height: 2.75rem;
  font-weight: 600;
  font-size: 0.9375rem;
}

.pdl-photo-crop__pick-different {
  display: inline-block;
  margin-top: 0.75rem;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--pdl-color-brand);
  text-decoration: underline;
}

.pdl-photo-crop__pick-different:hover {
  color: var(--pdl-color-text);
}

.pdl-photo-crop__pick-different-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
}

.pdl-photo-crop__pick input.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.pdl-photo-crop__workspace {
  display: none;
  text-align: center;
}

.pdl-profile-photo-editor.has-image .pdl-photo-crop__workspace {
  display: block;
}

.pdl-photo-crop__empty {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

.pdl-profile-photo-editor.has-image .pdl-photo-crop__pick-row {
  display: none;
}

.pdl-photo-crop__pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.pdl-photo-crop__pick input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.pdl-photo-crop__form input[type="file"] {
  display: none;
}

/* Metronic fixes .kt-sidebar-header at 70px and clips .kt-sidebar-logo — override so the full PDL mark shows */
#sidebar .kt-sidebar-header,
#sidebar .pdl-sidebar-header {
  height: auto;
  min-height: var(--header-height, 70px);
  overflow: visible;
  justify-content: center;
  padding-top: 1.25rem;
  padding-bottom: 0.375rem;
}

#sidebar .kt-sidebar-logo {
  width: 100%;
  overflow: visible;
  flex-shrink: 0;
}

#sidebar .kt-sidebar-logo a {
  display: block;
  width: 100%;
  line-height: 0;
}

#sidebar .kt-sidebar-logo .pdl-sidebar-logo {
  width: auto;
  max-width: 72%;
  height: auto;
  max-height: 5.5rem;
  display: block;
  margin-inline: auto;
  object-fit: contain;
}

#sidebar .pdl-sidebar-divider {
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 1rem;
  margin-bottom: 0;
  border: 0;
  background: color-mix(in srgb, var(--pdl-color-border, #cac4d0) 55%, transparent);
  opacity: 0.65;
}

[data-kt-theme-mode="dark"] #sidebar .pdl-sidebar-divider {
  background: color-mix(in srgb, var(--pdl-color-border, #49454f) 70%, transparent);
  opacity: 0.5;
}

body.kt-sidebar-collapse #sidebar .pdl-sidebar-divider {
  margin-inline: 0.35rem;
}

#sidebar .kt-sidebar-content {
  padding-top: 0.75rem;
}

#sidebar #sidebar_menu .kt-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  min-width: 0;
  font-family: var(--pdl-font);
}

#sidebar #sidebar_menu .kt-menu-item > .kt-menu-link,
#sidebar #sidebar_menu .kt-menu-item > .kt-menu-heading {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  min-width: 0;
  margin-inline: 0.375rem;
  border-radius: var(--pdl-radius-chip);
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--pdl-menu-text-muted);
  background: transparent;
  transition: background 0.18s ease, color 0.18s ease;
  cursor: pointer;
}

#sidebar #sidebar_menu .kt-menu-item > .kt-menu-link .kt-menu-title,
#sidebar #sidebar_menu .kt-menu-item > .kt-menu-heading .kt-menu-title {
  flex: 1;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  font-size: 0.875rem;
  font-weight: 500;
  color: inherit;
}

#sidebar #sidebar_menu .kt-menu-item > .kt-menu-link:hover {
  background: var(--pdl-menu-hover-bg);
  color: var(--pdl-color-brand-dark);
}

#sidebar #sidebar_menu .kt-menu-item.kt-menu-item-active > .kt-menu-link,
#sidebar #sidebar_menu .kt-menu-item.kt-menu-item-here > .kt-menu-link {
  background: var(--pdl-menu-active-bg);
  color: var(--pdl-menu-active-text);
  font-weight: 500;
}

#sidebar #sidebar_menu .kt-menu-item.kt-menu-item-active .kt-menu-icon,
#sidebar #sidebar_menu .kt-menu-item.kt-menu-item-here .kt-menu-icon {
  color: var(--pdl-menu-active-text);
}

#sidebar #sidebar_menu .kt-menu-item.kt-menu-item-show > .kt-menu-link {
  background: var(--pdl-menu-open-bg);
  color: var(--pdl-color-brand);
}

#sidebar #sidebar_menu .kt-menu-icon {
  flex-shrink: 0;
  width: 1.125rem;
  min-width: 1.125rem;
  height: 1.125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: var(--pdl-color-menu-icon);
}

#sidebar #sidebar_menu .kt-menu-icon.fa,
#sidebar #sidebar_menu .kt-menu-icon .fa {
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#sidebar #sidebar_menu .kt-menu-icon.fa::before,
#sidebar #sidebar_menu .kt-menu-icon .fa::before {
  line-height: 1;
  display: block;
}

#sidebar #sidebar_menu .kt-menu-item.kt-menu-item-active .kt-menu-icon,
#sidebar #sidebar_menu .kt-menu-item.kt-menu-item-show .kt-menu-icon,
#sidebar #sidebar_menu .kt-menu-item > .kt-menu-link:hover .kt-menu-icon {
  color: var(--pdl-color-brand);
}

#sidebar #sidebar_menu .kt-menu-icon svg {
  width: 1.125rem !important;
  height: 1.125rem !important;
}

#sidebar #sidebar_menu .kt-menu-icon svg [fill] {
  fill: currentColor !important;
}

#sidebar #sidebar_menu .kt-menu-item > .kt-menu-link .kt-menu-arrow {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 0;
  margin-inline-start: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.55;
  font-size: 0;
}

#sidebar #sidebar_menu .kt-menu-item.kt-menu-item-show > .kt-menu-link .kt-menu-arrow,
#sidebar #sidebar_menu .kt-menu-item.show > .kt-menu-link .kt-menu-arrow {
  transform: rotate(45deg);
  opacity: 1;
  color: var(--pdl-color-brand);
}

#sidebar #sidebar_menu .kt-menu-accordion > .kt-menu-arrow {
  display: none !important;
}

/* Only the direct accordion panel (not inner ul lists) */
#sidebar #sidebar_menu .kt-menu-item.kt-menu-item-accordion > .kt-menu-accordion {
  display: none !important;
  list-style: none;
  flex-direction: column;
}

#sidebar #sidebar_menu .kt-menu-item.kt-menu-item-accordion.show > .kt-menu-accordion,
#sidebar #sidebar_menu .kt-menu-item.kt-menu-item-accordion.kt-menu-item-show > .kt-menu-accordion {
  display: flex !important;
}

#sidebar #sidebar_menu {
  --pdl-submenu-icon-gap: 0.5rem;
}

#sidebar #sidebar_menu .pdl-menu-subnav {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

/* Sub-menu links — uniform gap between icon and label (all depths) */
#sidebar #sidebar_menu .kt-menu-accordion .kt-menu-link,
#sidebar #sidebar_menu .pdl-menu-subnav .kt-menu-link {
  display: flex;
  align-items: center;
  column-gap: var(--pdl-submenu-icon-gap);
  row-gap: 0;
}

#sidebar #sidebar_menu .kt-menu-accordion .kt-menu-item > .kt-menu-link,
#sidebar #sidebar_menu .pdl-menu-subnav .kt-menu-item > .kt-menu-link {
  padding: 6px 9px;
  border-radius: var(--pdl-radius-chip);
  font-size: 0.8125rem;
}

#sidebar #sidebar_menu .kt-menu-accordion .kt-menu-link > .kt-menu-icon,
#sidebar #sidebar_menu .pdl-menu-subnav .kt-menu-link > .kt-menu-icon,
#sidebar #sidebar_menu .kt-menu-accordion .kt-menu-link > .kt-menu-icon.fa,
#sidebar #sidebar_menu .pdl-menu-subnav .kt-menu-link > .kt-menu-icon.fa {
  flex-shrink: 0;
  margin-inline-end: 0;
}

#sidebar #sidebar_menu .kt-menu-accordion .kt-menu-link > .kt-menu-title,
#sidebar #sidebar_menu .pdl-menu-subnav .kt-menu-link > .kt-menu-title {
  margin-inline-start: 0;
  padding-inline-start: 0;
}

#sidebar #sidebar_menu .kt-menu-accordion .kt-menu-item > .kt-menu-link .kt-menu-title,
#sidebar #sidebar_menu .pdl-menu-subnav .kt-menu-item > .kt-menu-link .kt-menu-title {
  font-size: 0.8125rem;
}

#sidebar #sidebar_menu .kt-menu-accordion .kt-menu-item > .kt-menu-link:hover,
#sidebar #sidebar_menu .pdl-menu-subnav .kt-menu-item > .kt-menu-link:hover {
  background: var(--pdl-menu-hover-bg);
  color: var(--pdl-color-brand-dark);
  font-weight: 600;
}

#sidebar #sidebar_menu .kt-menu-accordion .kt-menu-item.kt-menu-item-active > .kt-menu-link,
#sidebar #sidebar_menu .pdl-menu-subnav .kt-menu-item.kt-menu-item-active > .kt-menu-link {
  background: var(--pdl-menu-active-bg);
  color: var(--pdl-menu-active-text);
  font-weight: 500;
}

/* Submenu tree — vertical guide + bullets (Metronic demo1 style) */
#sidebar #sidebar_menu .kt-menu-item.kt-menu-item-accordion > .kt-menu-accordion {
  --pdl-menu-tree-x: 20px;
  position: relative;
  margin: 0 0 8px 0;
  margin-inline-start: 10px;
  padding: 2px 0 4px 10px;
}

#sidebar #sidebar_menu .pdl-menu-subnav .kt-menu-item.kt-menu-item-accordion > .kt-menu-accordion {
  --pdl-menu-tree-x: 32px;
  margin-inline-start: 0;
  padding-inline-start: 22px;
}

#sidebar #sidebar_menu .kt-menu-item.kt-menu-item-accordion > .kt-menu-accordion::before {
  content: "";
  position: absolute;
  inset-inline-start: var(--pdl-menu-tree-x);
  top: 0;
  bottom: 0;
  border-inline-start: 1px solid var(--pdl-color-border);
  pointer-events: none;
  z-index: 0;
}

#sidebar #sidebar_menu .kt-menu-accordion .pdl-menu-subnav > .kt-menu-item > .kt-menu-link {
  position: relative;
  z-index: 1;
  padding-inline-start: 10px;
  column-gap: var(--pdl-submenu-icon-gap);
  background: transparent;
  /* Highlight inset: ~50% into gap between tree line and bullet icon */
  --pdl-submenu-line-inset: calc(var(--pdl-menu-tree-x, 20px) - 10px);
  --pdl-submenu-icon-inset: calc(10px + var(--pdl-menu-tree-x, 20px) - 3px);
  --pdl-submenu-bg-inset: calc(
    var(--pdl-submenu-line-inset) +
    (var(--pdl-submenu-icon-inset) - var(--pdl-submenu-line-inset)) * 0.5
  );
}

#sidebar #sidebar_menu .kt-menu-accordion .pdl-menu-subnav > .kt-menu-item > .kt-menu-link::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-inline-start: var(--pdl-submenu-bg-inset);
  inset-inline-end: 0;
  top: 0;
  bottom: 0;
  border-radius: var(--pdl-radius-chip);
  background: transparent;
  pointer-events: none;
}

#sidebar #sidebar_menu .kt-menu-accordion .pdl-menu-subnav > .kt-menu-item > .kt-menu-link:hover,
#sidebar #sidebar_menu .kt-menu-accordion .pdl-menu-subnav > .kt-menu-item.kt-menu-item-active > .kt-menu-link {
  background: transparent;
}

#sidebar #sidebar_menu .kt-menu-accordion .pdl-menu-subnav > .kt-menu-item > .kt-menu-link:hover::before {
  background: var(--pdl-menu-hover-bg);
}

#sidebar #sidebar_menu .kt-menu-accordion .pdl-menu-subnav > .kt-menu-item.kt-menu-item-active > .kt-menu-link::before {
  background: var(--pdl-menu-active-bg);
}

#sidebar #sidebar_menu .kt-menu-accordion .pdl-menu-subnav > .kt-menu-item > .kt-menu-link .kt-menu-icon {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-inline-start: calc(var(--pdl-menu-tree-x, 20px) - 3px);
}

#sidebar #sidebar_menu .kt-menu-accordion .pdl-menu-subnav > .kt-menu-item > .kt-menu-link .kt-menu-icon .bullet-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pdl-color-border);
  opacity: 1;
}

#sidebar #sidebar_menu .kt-menu-accordion .pdl-menu-subnav > .kt-menu-item > .kt-menu-link .kt-menu-icon:has(.fa) {
  width: 1rem;
  min-width: 1rem;
  margin-inline-start: calc(var(--pdl-menu-tree-x, 20px) - 6px);
}

#sidebar #sidebar_menu .kt-menu-accordion .pdl-menu-subnav > .kt-menu-item > .kt-menu-link .kt-menu-icon .fa {
  font-size: 0.75rem;
  line-height: 1;
  color: var(--pdl-color-menu-icon);
}

#sidebar #sidebar_menu .kt-menu-accordion .pdl-menu-subnav > .kt-menu-item > .kt-menu-link:hover .kt-menu-icon .bullet-dot,
#sidebar #sidebar_menu .kt-menu-accordion .pdl-menu-subnav > .kt-menu-item.kt-menu-item-active > .kt-menu-link .kt-menu-icon .bullet-dot {
  background: var(--pdl-color-brand);
}

#sidebar #sidebar_menu .kt-menu-accordion .pdl-menu-subnav > .kt-menu-item > .kt-menu-link:hover .kt-menu-icon .fa,
#sidebar #sidebar_menu .kt-menu-accordion .pdl-menu-subnav > .kt-menu-item.kt-menu-item-active > .kt-menu-link .kt-menu-icon .fa {
  color: var(--pdl-color-brand);
}

#sidebar #sidebar_menu .kt-menu-icon .bullet-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

#sidebar .pdl-sidebar-footer {
  margin-top: auto;
  padding: 16px 12px;
  font-size: 0.75rem;
  line-height: 1.35;
  text-align: center;
  color: var(--pdl-color-muted);
  border-top: 1px solid var(--pdl-color-border-soft);
}

#sidebar .pdl-sidebar-footer a {
  color: var(--pdl-color-brand);
  font-weight: 600;
}

body.kt-sidebar-collapse #sidebar {
  width: 88px !important;
  min-width: 88px !important;
  max-width: 88px !important;
}

body.kt-sidebar-collapse #sidebar #sidebar_toggle {
  right: -12px;
}

body.kt-sidebar-collapse #sidebar .pdl-sidebar-logo {
  max-width: 88%;
  max-height: 2.75rem;
}

body.kt-sidebar-collapse #sidebar #sidebar_content {
  padding-right: 0.25rem;
}

body.kt-sidebar-collapse #sidebar #sidebar_scrollable {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

body.kt-sidebar-collapse #sidebar #sidebar_menu .kt-menu-item > .kt-menu-link {
  justify-content: center;
  margin-inline: 0.15rem;
  padding-inline: 0.35rem;
}

body.kt-sidebar-collapse #sidebar #sidebar_menu .kt-menu-title,
body.kt-sidebar-collapse #sidebar #sidebar_menu .kt-menu-arrow,
body.kt-sidebar-collapse #sidebar #sidebar_menu .kt-menu-accordion,
body.kt-sidebar-collapse #sidebar .pdl-sidebar-footer {
  display: none !important;
}

/* Mobile sidebar drawer */
@media (max-width: 1023px) {
  #sidebar {
    display: flex;
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 80;
  }

  body.pdl-mobile-sidebar-open #sidebar {
    transform: translateX(0);
  }

  #pdl_mobile_sidebar_overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 12, 28, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 70;
  }

  body.pdl-mobile-sidebar-open #pdl_mobile_sidebar_overlay {
    opacity: 1;
    pointer-events: auto;
  }

  #pdl_mobile_menu_toggle {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: var(--pdl-color-white) !important;
    border-color: var(--pdl-color-chip-border) !important;
    color: var(--pdl-color-brand-dark) !important;
    box-shadow: 0 6px 14px var(--pdl-shadow-color-md);
  }

  #content {
    padding-top: 4rem !important;
  }

  body.pdl-mobile-sidebar-open #pdl_mobile_menu_toggle {
    opacity: 0;
    pointer-events: none;
  }

  body.pdl-mobile-sidebar-open {
    overflow: hidden;
  }
}

/* Filter chips — design idea.png typography (medium 500, not compat semibold) */
#dashboard_btns .kt-btn,
#dashboard_btns a.kt-btn,
#dashboard_btns button.kt-btn,
#content .kt-btn.kt-btn-sm,
#content a.kt-btn.kt-btn-sm,
#content button.kt-btn.kt-btn-sm {
  font-family: var(--pdl-font) !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  line-height: 1.25 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  min-height: 2rem;
  padding: 0.375rem 0.875rem !important;
  border-radius: var(--pdl-radius-chip) !important;
  box-shadow: none !important;
  transform: none !important;
}

#dashboard_btns .btn-primary,
#dashboard_btns .kt-btn-primary,
#content .kt-btn.kt-btn-sm.kt-btn-primary,
#content a.kt-btn.kt-btn-sm.kt-btn-primary,
#content button.kt-btn.kt-btn-sm.kt-btn-primary {
  background: var(--pdl-color-selection-bg) !important;
  border-color: var(--pdl-color-selection-bg) !important;
  color: var(--pdl-color-selection-text) !important;
  font-weight: 500 !important;
}

#dashboard_btns .btn-secondary,
#dashboard_btns .kt-btn-outline,
#content .kt-btn.kt-btn-sm.kt-btn-outline,
#content a.kt-btn.kt-btn-sm.kt-btn-outline,
#content button.kt-btn.kt-btn-sm.kt-btn-outline,
#content .kt-btn.kt-btn-sm.border,
#content a.kt-btn.kt-btn-sm.border,
#content button.kt-btn.kt-btn-sm.border {
  background: var(--pdl-color-white) !important;
  border-color: var(--pdl-color-chip-border) !important;
  color: var(--pdl-color-chip-text) !important;
  font-weight: 500 !important;
}

#dashboard_btns .btn-primary:hover,
#dashboard_btns .kt-btn-primary:hover,
#content .kt-btn.kt-btn-sm.kt-btn-primary:hover,
#content a.kt-btn.kt-btn-sm.kt-btn-primary:hover,
#content button.kt-btn.kt-btn-sm.kt-btn-primary:hover {
  background: #ebe0ff !important;
  border-color: #ebe0ff !important;
  color: var(--pdl-color-selection-text) !important;
}

#dashboard_btns .kt-btn-outline:hover,
#content .kt-btn.kt-btn-sm.kt-btn-outline:hover,
#content .kt-btn.kt-btn-sm.border:hover,
#content a.kt-btn.kt-btn-sm.border:hover,
#content button.kt-btn.kt-btn-sm.border:hover {
  background: var(--pdl-color-surface-soft) !important;
  border-color: var(--pdl-color-chip-border) !important;
  color: var(--pdl-color-selection-text) !important;
}

/* kt-btn-other — light blue accent (chip + full-size) */
#dashboard_btns .kt-btn-other,
#content .kt-btn.kt-btn-sm.kt-btn-other,
#content a.kt-btn.kt-btn-sm.kt-btn-other,
#content button.kt-btn.kt-btn-sm.kt-btn-other {
  background: var(--pdl-color-other-bg) !important;
  border-color: var(--pdl-color-other-border) !important;
  color: var(--pdl-color-other-text) !important;
  font-weight: 500 !important;
}

#dashboard_btns .kt-btn-other:hover,
#content .kt-btn.kt-btn-sm.kt-btn-other:hover,
#content a.kt-btn.kt-btn-sm.kt-btn-other:hover,
#content button.kt-btn.kt-btn-sm.kt-btn-other:hover {
  background: var(--pdl-color-other-hover-bg) !important;
  border-color: var(--pdl-color-other-hover-border) !important;
  color: var(--pdl-color-other-hover-text) !important;
}

.kt-btn.kt-btn-other {
  background-color: var(--pdl-color-other-bg);
  border-color: var(--pdl-color-other-border);
  color: var(--pdl-color-other-text);
}

.kt-btn.kt-btn-other:hover {
  background-color: var(--pdl-color-other-hover-bg);
  border-color: var(--pdl-color-other-hover-border);
  color: var(--pdl-color-other-hover-text);
}

.kt-btn.kt-btn-other:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--pdl-color-other-text) 35%, transparent);
  outline-offset: 2px;
}

/* Full-size action buttons (Search, Submit, etc.) keep solid primary */
#content .kt-btn-primary:not(.kt-btn-sm),
#content a.kt-btn-primary:not(.kt-btn-sm),
#content button.kt-btn-primary:not(.kt-btn-sm) {
  color: var(--pdl-color-white) !important;
  font-weight: 600 !important;
}

#content .kt-btn-other:not(.kt-btn-sm),
#content a.kt-btn-other:not(.kt-btn-sm),
#content button.kt-btn-other:not(.kt-btn-sm) {
  background: var(--pdl-color-other-bg) !important;
  border-color: var(--pdl-color-other-border) !important;
  color: var(--pdl-color-other-text) !important;
  font-weight: 600 !important;
}

#content .kt-btn-other:not(.kt-btn-sm):hover,
#content a.kt-btn-other:not(.kt-btn-sm):hover,
#content button.kt-btn-other:not(.kt-btn-sm):hover {
  background: var(--pdl-color-other-hover-bg) !important;
  border-color: var(--pdl-color-other-hover-border) !important;
  color: var(--pdl-color-other-hover-text) !important;
}

.d-none {
  display: none !important;
}

.text-center {
  text-align: center !important;
}

/* Sidebar width + scroll — long labels wrap inside light aside */
#sidebar.kt-sidebar {
  width: 280px;
  min-width: 280px;
  max-width: 280px;
}

#sidebar .kt-sidebar-content,
#sidebar .kt-scrollable-y-hover,
#sidebar #sidebar_scrollable,
#sidebar #sidebar_menu {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

#sidebar #sidebar_menu.pdl-sidebar-menu .menu-item > .menu-link,
#sidebar #sidebar_menu.pdl-sidebar-menu .menu-item > .menu-link .menu-text {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

#sidebar #sidebar_menu.pdl-sidebar-menu .menu-submenu {
  max-width: 100%;
  margin-inline-start: 12px;
  margin-inline-end: 4px;
}

#sidebar #sidebar_menu.pdl-sidebar-menu .menu-subnav .menu-submenu {
  margin-inline-start: 8px;
}

/* Active list — AJAX table (replaces jQuery DataTables) */
.pdl-activelist-table tbody tr:hover {
  background-color: #ffffaa;
}

.pdl-datatable-shell .pdl-top-songs-store-list .kt-card-table {
  width: 100%;
}

/* KTUI admin modals */
#AdminModal .kt-modal-content {
  max-width: min(90vw, 1200px);
}

#AdminModal .kt-modal-body {
  max-height: min(75vh, 720px);
  overflow-y: auto;
}

.pdl-logout-modal .kt-modal-content {
  max-width: 400px;
}

.pdl-logout-modal__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pdl-logout-modal__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--pdl-color-text);
  text-align: center;
  flex: 1;
}

.pdl-logout-modal__footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--pdl-color-border);
}

.pdl-logout-modal__footer .pdl-split-btn {
  width: 100%;
  max-width: none;
}

/* Split label + icon panel (Metronic kt-btn base) */
.kt-btn.pdl-split-btn {
  display: inline-flex;
  align-items: stretch;
  padding: 0;
  gap: 0;
  border: none !important;
  border-radius: 0.475rem;
  overflow: hidden;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1;
  box-shadow: none;
  text-decoration: none;
  background: transparent !important;
  --pdl-split-bg: var(--pdl-color-surface-container-high);
  --pdl-split-bg-dark: var(--pdl-color-border);
  --pdl-split-fg: var(--pdl-color-text);
  --pdl-split-divider: rgba(29, 27, 32, 0.12);
}

.kt-btn.pdl-split-btn:hover,
.kt-btn.pdl-split-btn:focus-visible {
  text-decoration: none;
}

.kt-btn.pdl-split-btn .pdl-split-btn__label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  background: var(--pdl-split-bg) !important;
  color: var(--pdl-split-fg);
}

.kt-btn.pdl-split-btn .pdl-split-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.75rem;
  background: var(--pdl-split-bg-dark) !important;
  color: var(--pdl-split-fg);
  border-inline-start: 1px solid var(--pdl-split-divider);
}

.kt-btn.pdl-split-btn .pdl-split-btn__icon i {
  font-size: 1.15rem;
  line-height: 1;
}

/* Sign out — alert / destructive */
.kt-btn.pdl-split-btn.pdl-split-btn--danger {
  --pdl-split-bg: var(--pdl-color-danger);
  --pdl-split-bg-dark: color-mix(in srgb, var(--pdl-color-danger) 82%, #000);
  --pdl-split-fg: var(--pdl-color-white);
  --pdl-split-divider: rgba(255, 255, 255, 0.22);
}

.kt-btn.pdl-split-btn.pdl-split-btn--danger:hover,
.kt-btn.pdl-split-btn.pdl-split-btn--danger:focus-visible {
  filter: brightness(1.06);
}

.kt-btn.pdl-split-btn.pdl-split-btn--danger:hover .pdl-split-btn__label,
.kt-btn.pdl-split-btn.pdl-split-btn--danger:focus-visible .pdl-split-btn__label {
  background: color-mix(in srgb, var(--pdl-color-danger) 92%, #fff) !important;
}

/* Cancel — light gray (matches outline / secondary toolbar buttons) */
.kt-btn.pdl-split-btn.pdl-split-btn--cancel {
  --pdl-split-bg: var(--pdl-color-white);
  --pdl-split-bg-dark: var(--pdl-color-surface-container-high);
  --pdl-split-fg: var(--pdl-color-chip-text);
  --pdl-split-divider: var(--pdl-color-chip-border);
  border: 1px solid var(--pdl-color-chip-border) !important;
}

.kt-btn.pdl-split-btn.pdl-split-btn--cancel:hover,
.kt-btn.pdl-split-btn.pdl-split-btn--cancel:focus-visible {
  --pdl-split-bg: var(--pdl-color-surface-soft);
  --pdl-split-bg-dark: var(--pdl-color-surface-container);
  --pdl-split-fg: var(--pdl-color-selection-text);
}

/* Streaming trends toolbar — 4 sections + design picker */
.pdl-platform-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pdl-trends-toolbar-sections {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 20px;
}

.pdl-trends-toolbar__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.pdl-trends-toolbar__section--end {
  margin-left: auto;
}

.pdl-trends-toolbar__section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pdl-color-muted);
}

.pdl-trends-toolbar__section-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Option A / live — connected segmented pills (htmldesign) */
.pdl-toolbar-design-picker .pdl-segmented-control,
#l1report_toolbar .pdl-segmented-control,
#dashboard_btns .pdl-segmented-control {
  display: inline-flex;
  border: 1px solid var(--pdl-color-border);
  border-radius: 9999px;
  overflow: hidden;
  background: var(--pdl-color-white);
  padding: 0;
}

.pdl-toolbar-design-picker .pdl-segment-btn,
#l1report_toolbar .pdl-segment-btn,
#dashboard_btns .pdl-segment-btn {
  border: none;
  background: transparent;
  padding: 8px 18px;
  font-family: var(--pdl-font);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25;
  color: var(--pdl-color-muted);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transform: none;
  min-height: 0;
}

.pdl-toolbar-design-picker .pdl-segment-btn:not(:last-child),
#dashboard_btns .pdl-segment-btn:not(:last-child),
#l1report_toolbar .pdl-segmented-control:not(.pdl-segmented-control--platforms) > .pdl-segment-btn:not(:last-child) {
  border-right: 1px solid var(--pdl-color-border);
}

.pdl-toolbar-design-picker .pdl-segment-btn:hover:not(:disabled),
#dashboard_btns .pdl-segment-btn:hover,
#l1report_toolbar .pdl-segment-btn:hover:not(:disabled) {
  background: var(--pdl-color-brand-hover-soft);
  color: var(--pdl-color-brand-dark);
}

.pdl-toolbar-design-picker .pdl-segment-btn.active,
#dashboard_btns .pdl-segment-btn.active,
#l1report_toolbar .pdl-segment-btn.active {
  background: var(--pdl-color-brand-soft);
  color: var(--pdl-color-brand-dark);
}

.pdl-toolbar-design-picker .pdl-icon-btn-circle,
#dashboard_btns .pdl-icon-btn-circle,
#l1report_toolbar .pdl-icon-btn-circle {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--pdl-color-border);
  background: var(--pdl-color-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--pdl-color-muted);
  box-shadow: none;
  transform: none;
}

.pdl-toolbar-design-picker .pdl-icon-btn-circle:hover:not(:disabled),
#dashboard_btns .pdl-icon-btn-circle:hover,
#l1report_toolbar .pdl-icon-btn-circle:hover:not(:disabled) {
  background: var(--pdl-color-brand-hover-soft);
  color: var(--pdl-color-brand);
}

.pdl-toolbar-design-picker .pdl-platform-btn,
#l1report_toolbar .pdl-platform-btn,
#dashboard_btns .pdl-platform-btn {
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  padding: 6px;
  margin: 0;
}

.pdl-toolbar-design-picker .pdl-platform-btn img,
#l1report_toolbar .pdl-platform-btn img,
#dashboard_btns .pdl-platform-btn img,
.pdl-toolbar-design-picker .pdl-platform-btn .pdl-platform-icon,
#l1report_toolbar .pdl-platform-btn .pdl-platform-icon,
#dashboard_btns .pdl-platform-btn .pdl-platform-icon,
.pdl-toolbar-design-picker .pdl-platform-btn svg,
#l1report_toolbar .pdl-platform-btn svg,
#dashboard_btns .pdl-platform-btn svg,
.pdl-toolbar-design-picker .pdl-platform-btn .pdl-platform-sprite-icon,
#l1report_toolbar .pdl-platform-btn .pdl-platform-sprite-icon,
#dashboard_btns .pdl-platform-btn .pdl-platform-sprite-icon {
  display: block;
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  object-fit: contain;
  pointer-events: none;
  flex-shrink: 0;
}

.pdl-platform-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.pdl-toolbar-design-picker .pdl-platform-btn.active,
#dashboard_btns .pdl-platform-btn.active,
#l1report_toolbar .pdl-platform-btn.active {
  border-color: var(--pdl-color-brand-soft);
  background: var(--pdl-color-brand-soft);
  box-shadow: 0 0 0 1px var(--pdl-color-brand-soft);
}

/* Platform row — dashboard-style: All (left) | icon pill | Clear (right) */
#l1report_toolbar .l1report-toolbar-row--platforms {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: nowrap;
}

#l1report_toolbar .l1report-platform-bulk-actions--start,
#l1report_toolbar .l1report-platform-bulk-actions--end {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

#l1report_toolbar .l1report-platform-bulk-actions--end {
  justify-self: end;
}

#l1report_toolbar #l1report-platform-bar.pdl-segmented-control--platforms {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-self: start;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--pdl-color-border);
  border-radius: 9999px;
  background: var(--pdl-color-white);
  padding: 0;
}

#l1report_toolbar .pdl-segmented-control--platforms > .pdl-platform-btn:not(:last-child) {
  border-right: 1px solid var(--pdl-color-border);
}

#l1report_toolbar .pdl-segmented-control--platforms .pdl-platform-btn {
  border: none;
  border-radius: 0;
  flex-shrink: 0;
}

/* Icon-only platform pills — do not inherit text-segment padding (avoids label/alt under logo) */
#l1report_toolbar .pdl-segmented-control--platforms > .pdl-segment-btn.pdl-platform-btn,
#dashboard_btns .pdl-segmented-control--platforms > .pdl-segment-btn--platform.pdl-platform-btn,
#pdl_trend_v2 .pdl-segmented-control--platforms > .pdl-segment-btn--platform.pdl-platform-btn {
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  padding: 6px;
  font-size: 0;
  line-height: 0;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow: hidden;
}

#l1report_toolbar .pdl-segmented-control--platforms .pdl-platform-btn .pdl-platform-icon-wrap,
#dashboard_btns .pdl-segmented-control--platforms .pdl-segment-btn--platform .pdl-platform-icon-wrap,
#pdl_trend_v2 .pdl-segmented-control--platforms .pdl-platform-btn .pdl-platform-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

#l1report_toolbar .pdl-segmented-control--platforms .pdl-platform-btn:not(.active) {
  opacity: 0.45;
  filter: grayscale(0.35);
}

#l1report_toolbar .pdl-segmented-control--platforms .pdl-platform-btn.active {
  opacity: 1;
  filter: none;
  background: var(--pdl-color-brand-medium);
  box-shadow: none;
}

/* L1 Revenue Trends — exactly two toolbar rows */
#l1report_toolbar.pdl-trends-toolbar--live {
  padding-left: 1rem;
  padding-right: 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

#l1report_toolbar .l1report-toolbar-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

#l1report_toolbar .l1report-toolbar-row--filters {
  overflow-x: auto;
  align-items: center;
}

#l1report_toolbar .l1report-toolbar-row--filters > .pdl-segmented-control {
  align-self: center;
}

#l1report_toolbar .pdl-icon-btn-circle img {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

#l1report_toolbar .l1report-toolbar-dates {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

#l1report_toolbar .l1report-toolbar-month-fields {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

#l1report_toolbar .l1report-toolbar-month-sep {
  color: var(--pdl-color-muted);
  flex-shrink: 0;
  line-height: 1;
}

#l1report_toolbar .l1report-toolbar-dates .pdl-myp-wrap {
  width: fit-content;
  min-width: 0;
  max-width: var(--pdl-picker-width-month);
  flex-shrink: 0;
  align-self: center;
}

#l1report_toolbar .l1report-toolbar-dates .pdl-myp-trigger {
  min-height: 2.5rem;
  height: auto;
  width: auto;
  padding: 0 0.25rem 0 0.4rem;
  font-size: 0.875rem;
  line-height: 1.25;
  box-sizing: border-box;
}

#l1report_toolbar .l1report-toolbar-dates .pdl-myp-display {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

#l1report_toolbar .l1report-toolbar-dates .pdl-myp-icon {
  font-size: 0.875rem;
  margin-left: 0;
}

/* Site-wide single-row filter / upload toolbars */
.pdl-form-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.pdl-form-toolbar--stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}

.pdl-form-toolbar__main {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.pdl-form-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  width: 100%;
  min-width: 0;
}

.pdl-form-toolbar__field--inline {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  min-width: 0;
}

.pdl-form-toolbar__prompt {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pdl-color-text-secondary, #475569);
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

.pdl-form-toolbar__field--grow {
  flex: 1 1 10rem;
  min-width: 8rem;
}

.pdl-form-toolbar__field--grow .kt-input {
  width: 100%;
  min-width: 0;
}

.pdl-form-toolbar__field--label .pdl-label-picker.pdl-sign-in-field {
  width: 12rem;
  min-width: 12rem;
}

.pdl-form-toolbar__field--date .kt-input.pdl-date-picker,
.pdl-form-toolbar__field--date .pdl-myp-wrap[data-granularity="date"] {
  width: var(--pdl-picker-width-date);
  min-width: var(--pdl-picker-width-date);
  max-width: var(--pdl-picker-width-date);
}

.pdl-form-toolbar__field--date .pdl-myp-wrap:not([data-granularity="date"]) {
  width: var(--pdl-picker-width-month);
  min-width: var(--pdl-picker-width-month);
  max-width: var(--pdl-picker-width-month);
}

.pdl-form-toolbar__field--select .kt-input,
.pdl-form-toolbar__field--select select {
  width: 11rem;
  min-width: 11rem;
}

.pdl-form-toolbar__field--file .kt-input[type="file"],
.pdl-form-toolbar__field--file input[type="file"] {
  width: auto;
  max-width: 16rem;
  padding: 0.35rem 0.5rem;
}

.pdl-form-toolbar__radio-group {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.65rem;
}

.pdl-form-toolbar__radio {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.8125rem;
  white-space: nowrap;
  cursor: pointer;
}

.pdl-form-toolbar__actions {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Results tables — card below filter toolbar */
.pdl-results-card {
  border: 1px solid var(--pdl-color-border-soft);
}

.pdl-add-report-card {
  border: 1px solid var(--pdl-color-border-soft);
  min-width: 14rem;
  cursor: pointer;
}

.pdl-add-report-card:hover {
  border-color: var(--color-primary, #3b82f6);
}

.pdl-add-report-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

@media (max-width: 1199px) {
  .pdl-form-toolbar {
    flex-wrap: wrap;
  }

  .pdl-form-toolbar__main {
    flex-wrap: wrap;
  }

  .pdl-form-toolbar__actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
}

/* Filter toolbars — Go / Reset / Download (site-wide) */
.l1report-toolbar-actions,
.pdl-form-toolbar-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.l1report-toolbar-actions .kt-btn,
.pdl-form-toolbar-actions .kt-btn {
  min-height: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
}

.l1report-toolbar-actions .kt-btn .fa,
.pdl-form-toolbar-actions .kt-btn .fa {
  font-size: 0.875rem;
  line-height: 1;
}

/* Site-wide filter spacing + control height (toolbars, meta search, legacy rows/tables) */
:root {
  --pdl-filter-field-gap: 0.65rem;
  --pdl-filter-actions-gap: 8px;
  --pdl-filter-control-height: 2.5rem;
  /* Standard picker entry widths — see templates/metronicdesign/PDL-UI-DESIGN.md § Standard picker entry widths */
  --pdl-picker-width-month: 9rem;
  --pdl-picker-width-date: 7.5rem;
  --pdl-picker-width-platform: 9.5rem;
  --pdl-picker-width-platform-multi: 12rem;
  --pdl-picker-width-language: 9rem;
  --pdl-picker-width-language-multi: 12rem;
}

.pdl-form-toolbar,
.pdl-form-toolbar__main,
.pdl-form-toolbar__row,
.pdl-meta-search-toolbar,
.pdl-filter-toolbar,
form.typeahead > .flex.flex-wrap,
form#search > .flex.flex-wrap {
  gap: var(--pdl-filter-field-gap);
}

.pdl-meta-search-toolbar .pdl-meta-search-actions,
.pdl-meta-search-actions.l1report-toolbar-actions {
  gap: var(--pdl-filter-actions-gap);
  margin-left: auto;
}

.pdl-meta-search-toolbar .pdl-meta-search-actions .kt-btn,
.pdl-meta-search-actions.l1report-toolbar-actions .kt-btn {
  min-height: var(--pdl-filter-control-height);
  height: var(--pdl-filter-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
}

/* Legacy filter rows (flex + p-3 wrappers) */
.pdl-filter-toolbar,
form.typeahead > .flex.flex-wrap.border-bottom,
form.typeahead > .flex.flex-wrap.gap-4,
form#search > .flex.flex-wrap,
form#search > .pdl-filter-toolbar,
form.typeahead > .pdl-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--pdl-filter-field-gap);
}

form.typeahead > .flex.flex-wrap > .p-3,
form.typeahead > .flex.flex-wrap > .pl-4,
form#search > .flex.flex-wrap > .p-3,
form#search > .pdl-filter-toolbar > div,
.pdl-filter-toolbar > .p-3,
.pdl-filter-toolbar > div,
.pdl-filter-toolbar__field {
  padding: 0 !important;
  margin: 0;
}

/* Admin forms — card shell + legacy widget bodies */
.pdl-form-card {
  border: 1px solid var(--pdl-color-border-soft, #e2e8f0);
}

.pdl-form-card > .kt-card-body > form,
.widget-body > form,
.widget-body form {
  margin: 0;
}

.widget-body form .kt-input,
.widget-body form select.kt-input,
.widget-body form input[type="text"],
.widget-body form input[type="email"],
.widget-body form input[type="number"],
.widget-body form select {
  min-height: var(--pdl-filter-control-height);
  box-sizing: border-box;
}

.widget-body form table td {
  padding: 0 calc(var(--pdl-filter-field-gap) / 2) 0 0 !important;
  vertical-align: middle;
}

.widget-body form .l1report-toolbar-actions,
.widget-body form td:has(.kt-btn) {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--pdl-filter-actions-gap);
}

.pdl-filter-toolbar__actions,
form.typeahead .pdl-filter-toolbar__actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--pdl-filter-actions-gap);
  flex-shrink: 0;
}

/* Table-based filter forms */
form.typeahead table td,
form#search table td,
.pdl-form-card form table td {
  padding: 0 calc(var(--pdl-filter-field-gap) / 2) 0 0 !important;
  vertical-align: middle;
}

form.typeahead table td:has(.kt-btn),
form#search table td:has(.kt-btn),
.pdl-form-card form table td:has(.kt-btn) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--pdl-filter-actions-gap);
  white-space: nowrap;
}

form.typeahead .kt-input,
form#search .kt-input,
.pdl-form-toolbar .kt-input,
.pdl-meta-search-toolbar .kt-input,
.pdl-filter-toolbar .kt-input,
.pdl-form-card form .kt-input,
.pdl-form-card form select.kt-input {
  min-height: var(--pdl-filter-control-height);
  box-sizing: border-box;
}

/* Filter actions — Go primary, Reset outline (site-wide) */
form.typeahead .kt-btn-primary,
.pdl-form-toolbar .kt-btn-primary,
.pdl-meta-search-actions .kt-btn-primary,
.l1report-toolbar-actions .kt-btn-primary,
.pdl-form-toolbar-actions .kt-btn-primary,
.pdl-filter-toolbar__actions .kt-btn-primary {
  background-color: var(--pdl-color-brand, var(--primary));
  border-color: var(--pdl-color-brand, var(--primary));
  color: #fff;
}

form.typeahead .kt-btn-other,
.pdl-form-toolbar .kt-btn-other,
.pdl-meta-search-actions .kt-btn-other,
.l1report-toolbar-actions .kt-btn-other,
.pdl-form-toolbar-actions .kt-btn-other,
.pdl-filter-toolbar__actions .kt-btn-other {
  background-color: var(--pdl-color-other-bg);
  border-color: var(--pdl-color-other-border);
  color: var(--pdl-color-other-text);
}

form.typeahead .kt-btn-other:hover,
.pdl-form-toolbar .kt-btn-other:hover,
.pdl-meta-search-actions .kt-btn-other:hover,
.l1report-toolbar-actions .kt-btn-other:hover,
.pdl-form-toolbar-actions .kt-btn-other:hover,
.pdl-filter-toolbar__actions .kt-btn-other:hover {
  background-color: var(--pdl-color-other-hover-bg);
  border-color: var(--pdl-color-other-hover-border);
  color: var(--pdl-color-other-hover-text);
}

form.typeahead .kt-btn-outline,
.pdl-form-toolbar .kt-btn-outline,
.pdl-meta-search-actions .kt-btn-outline,
.l1report-toolbar-actions .kt-btn-outline,
.pdl-form-toolbar-actions .kt-btn-outline,
.pdl-filter-toolbar__actions .kt-btn-outline,
form.typeahead button[type="reset"].kt-btn,
form.typeahead button[onclick*="reset" i].kt-btn-outline,
form.typeahead button[onclick*="Reset" i].kt-btn-outline {
  background-color: transparent;
  border-color: var(--pdl-color-border, #cbd5e1);
  color: var(--pdl-color-text, #1e293b);
}

/* Wrong variant on filter Reset — normalize to outline */
form.typeahead button[onclick*="reset" i].kt-btn-destructive,
form.typeahead button[onclick*="Reset" i].kt-btn-destructive,
form.typeahead button[type="reset"].kt-btn-destructive,
form.typeahead button[type="reset"].kt-btn-primary,
.pdl-meta-search-actions .kt-btn-destructive,
.l1report-toolbar-actions .kt-btn-destructive:not(.pdl-btn-destructive-keep) {
  background-color: transparent !important;
  border-color: var(--pdl-color-border, #cbd5e1) !important;
  color: var(--pdl-color-text, #1e293b) !important;
}

#l1report_toolbar .l1report-toolbar-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#l1report_toolbar .l1report-toolbar-actions .kt-btn {
  min-height: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
}

#l1report_toolbar .l1report-toolbar-admin {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}

#l1report_toolbar .l1report-toolbar-admin .kt-input {
  width: 10rem;
  min-width: 8rem;
}

#l1report_toolbar .pdl-segmented-control {
  flex-shrink: 0;
}

/* Trends toolbar — dashboard only (Option A live layout) */
#dashboard_btns.pdl-trends-toolbar--live {
  padding-left: 1rem;
  padding-right: 1rem;
  display: flex;
  align-items: center;
}

/* Platforms | period (centered in gap) | export — one row on laptop+ */
#dashboard_btns .pdl-trends-toolbar-sections.pdl-trends-toolbar-sections--option-a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  align-content: center;
  gap: 12px 20px;
  width: 100%;
  min-height: 44px;
  padding: 0 0.75rem;
  box-sizing: border-box;
}

#dashboard_btns .pdl-trends-toolbar-sections--option-a .pdl-trends-toolbar__section {
  display: flex;
  flex-direction: row;
  align-items: center;
  align-self: center;
  gap: 0;
  min-height: 0;
}

#dashboard_btns .pdl-trends-toolbar__section--platforms {
  justify-self: start;
  align-self: center;
  flex-shrink: 0;
  min-width: 0;
}

#dashboard_btns .pdl-trends-toolbar__section--period {
  justify-self: center;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  width: 100%;
}

#dashboard_btns .pdl-trends-toolbar__section--export {
  justify-self: end;
  align-self: center;
  margin-left: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

#dashboard_btns .pdl-trends-toolbar__stack {
  min-width: 0;
}

#dashboard_btns .pdl-trends-toolbar__meta-notice {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  line-height: 1.35;
}

#dashboard_btns .pdl-segmented-control--chart-style {
  flex-shrink: 0;
}

#dashboard_btns .pdl-segmented-control,
#dashboard_btns .pdl-segmented-control--platforms {
  align-items: center;
  align-self: center;
}

#dashboard_btns .pdl-segmented-control--platforms {
  display: inline-flex;
  flex-wrap: nowrap;
  max-width: none;
  width: max-content;
}

#dashboard_btns .pdl-segment-btn--platform,
#dashboard_btns #total.pdl-segment-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding-top: 6px;
  padding-bottom: 6px;
}

#dashboard_btns .pdl-segment-btn--platform {
  padding-left: 10px;
  padding-right: 10px;
  min-width: 40px;
}

#dashboard_btns .pdl-segment-btn--platform img,
#dashboard_btns .pdl-segment-btn--platform .pdl-platform-icon-mount,
#dashboard_btns .pdl-segment-btn--platform .pdl-platform-icon-mount svg,
#dashboard_btns .pdl-segment-btn--platform .pdl-platform-sprite-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  pointer-events: none;
  flex-shrink: 0;
}

#dashboard_btns .pdl-segment-btn--platform .pdl-platform-icon-mount {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

#dashboard_btns .pdl-segment-btn--platform.active {
  background: var(--pdl-color-brand-soft);
  color: var(--pdl-color-brand-dark);
}

/* Total view — platforms included in aggregate (all except Meta) */
#pdl_trend_v2 .pdl-platform-btn.pdl-platform-btn--in-total {
  background: #dbeafe;
  border-color: #bfdbfe;
  box-shadow: 0 0 0 1px #bfdbfe;
}

#pdl_trend_v2 .pdl-platform-btn.pdl-platform-btn--in-total:hover {
  background: #bfdbfe;
}

/* Trend v2 — icon-only platform segments (do not use text pill padding) */
#pdl_trend_v2 .pdl-segmented-control--platforms .pdl-segment-btn--platform.pdl-platform-btn {
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  padding: 6px;
  margin: 0;
}

#pdl_trend_v2 .pdl-segmented-control--platforms .pdl-segment-btn--platform.pdl-platform-btn .pdl-platform-icon-mount,
#pdl_trend_v2 .pdl-segmented-control--platforms .pdl-segment-btn--platform.pdl-platform-btn .pdl-platform-icon-mount svg,
#pdl_trend_v2 .pdl-segmented-control--platforms .pdl-segment-btn--platform.pdl-platform-btn .pdl-platform-sprite-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  pointer-events: none;
  flex-shrink: 0;
}

#pdl_trend_v2 .pdl-segmented-control--platforms .pdl-segment-btn--platform.pdl-platform-btn .pdl-platform-icon-mount {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Design picker — stacked option rows */
.pdl-toolbar-design-picker__intro {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--pdl-color-muted);
  line-height: 1.5;
}

.pdl-toolbar-option {
  margin-bottom: 1.25rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--pdl-color-border-soft);
  border-radius: 12px;
  background: var(--pdl-color-surface-subtle);
}

.pdl-toolbar-option:last-child {
  margin-bottom: 0;
}

.pdl-toolbar-option__label {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--pdl-color-brand-dark);
  margin-bottom: 0.875rem;
}

.pdl-toolbar-option__tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--pdl-color-muted);
  margin-left: 0.35rem;
}

/* Option B — separate floating capsules */
.pdl-toolbar-option--b .pdl-capsule-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pdl-toolbar-option--b .pdl-capsule {
  border: 1px solid var(--pdl-color-chip-border);
  border-radius: 9999px;
  background: var(--pdl-color-white);
  padding: 8px 16px;
  font-family: var(--pdl-font);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--pdl-color-chip-text);
  cursor: default;
}

.pdl-toolbar-option--b .pdl-capsule.active {
  border-color: var(--pdl-color-brand-soft);
  background: var(--pdl-color-brand-soft);
  color: var(--pdl-color-brand-dark);
}

.pdl-toolbar-option--b .pdl-capsule-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 8px;
  border-radius: 9999px;
}

.pdl-toolbar-option--b .pdl-capsule--icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Option C — soft lavender capsules (design idea) */
.pdl-toolbar-option--c .pdl-capsule-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pdl-toolbar-option--c .pdl-capsule {
  border: 1px solid var(--pdl-color-chip-border);
  border-radius: var(--pdl-radius-chip);
  background: var(--pdl-color-white);
  padding: 8px 16px;
  font-family: var(--pdl-font);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--pdl-color-chip-text);
}

.pdl-toolbar-option--c .pdl-capsule.active,
.pdl-toolbar-option--c .pdl-capsule--soft.active {
  border-color: var(--pdl-color-selection-bg);
  background: var(--pdl-color-selection-bg);
  color: var(--pdl-color-selection-text);
}

.pdl-toolbar-option--c .pdl-capsule-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 8px;
  border-radius: var(--pdl-radius-chip);
}

.pdl-toolbar-option--c .pdl-capsule--soft {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Option D — unified toolbar band */
.pdl-toolbar-option--d .pdl-trends-toolbar-sections--band {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--pdl-color-border-soft);
  background: var(--pdl-color-surface-soft);
  gap: 12px 18px;
}

.pdl-toolbar-option--d .pdl-segmented-control--inset {
  border-color: var(--pdl-color-border-soft);
  background: var(--pdl-color-white);
}

.pdl-toolbar-option--d .pdl-capsule--soft {
  border: 1px solid var(--pdl-color-chip-border);
  border-radius: var(--pdl-radius-chip);
  background: var(--pdl-color-white);
  padding: 8px 12px;
  color: var(--pdl-color-selection-text);
}

@media (max-width: 767px) {
  .pdl-trends-toolbar__section--end {
    margin-left: 0;
    width: 100%;
  }

  .pdl-trends-toolbar-sections {
    flex-direction: column;
    align-items: stretch;
  }

  #dashboard_btns .pdl-trends-toolbar-sections.pdl-trends-toolbar-sections--option-a {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  #dashboard_btns .pdl-trends-toolbar__section--platforms,
  #dashboard_btns .pdl-trends-toolbar__section--period,
  #dashboard_btns .pdl-trends-toolbar__section--export {
    justify-self: stretch;
    width: 100%;
  }

  #dashboard_btns .pdl-trends-toolbar__section--period {
    justify-content: center;
  }

  #dashboard_btns .pdl-segmented-control--platforms {
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
  }

  /* L1 Revenue and Stream — stack filters; keep platform strip horizontal scroll */
  #l1report_toolbar.pdl-trends-toolbar--live {
    gap: 10px;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  #l1report_toolbar .l1report-toolbar-row--filters {
    flex-direction: column;
    align-items: stretch;
    overflow-x: visible;
    gap: 10px;
  }

  #l1report_toolbar .l1report-toolbar-row--filters > .pdl-segmented-control:not(.pdl-segmented-control--platforms) {
    display: flex;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
  }

  #l1report_toolbar .l1report-toolbar-row--filters > .pdl-segmented-control:not(.pdl-segmented-control--platforms) > .pdl-segment-btn {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  #l1report_toolbar .l1report-toolbar-dates {
    display: flex;
    width: 100%;
    justify-content: stretch;
  }

  #l1report_toolbar .l1report-toolbar-month-fields {
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
    gap: 8px;
  }

  #l1report_toolbar .l1report-toolbar-month-fields .kt-input,
  #l1report_toolbar .l1report-toolbar-month-fields .pdl-myp-wrap {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }

  #l1report_toolbar .l1report-toolbar-month-fields .pdl-myp-trigger {
    width: 100%;
  }

  #l1report_toolbar .l1report-toolbar-actions {
    display: flex;
    width: 100%;
    gap: 8px;
  }

  #l1report_toolbar .l1report-toolbar-actions .kt-btn {
    flex: 1 1 0;
    min-width: 0;
  }

  #l1report_toolbar .l1report-toolbar-admin {
    margin-left: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  #l1report_toolbar .l1report-toolbar-admin .kt-input {
    width: 100%;
    min-width: 0;
  }

  #l1report_toolbar .l1report-toolbar-row--platforms {
    gap: 8px 10px;
  }

  #l1report_toolbar #l1report-platform-bar.pdl-segmented-control--platforms {
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
}

/* Top trends / analytics blocks */
.pdl-analytics-section .kt-card-body {
  padding-top: 1rem;
}

.pdl-analytics-card {
  border: 1px solid var(--pdl-color-border-soft);
  border-radius: 0.75rem;
  background: var(--pdl-color-surface);
  padding: 1rem 1.25rem;
}

.pdl-analytics-card__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--pdl-color-border-soft);
}

.pdl-analytics-card__title {
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 0;
}

.pdl-analytics-card__title a {
  color: var(--pdl-color-brand-dark);
}

.pdl-analytics-card__title-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}

.pdl-analytics-card__title-link:hover {
  color: var(--pdl-color-brand);
}

.pdl-analytics-card__external-icon {
  font-size: 0.8rem;
  line-height: 1;
  opacity: 0.7;
  flex-shrink: 0;
}

.pdl-analytics-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Chart cards: title + controls on one row */
.pdl-analytics-card__toolbar--chart {
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.pdl-analytics-card__toolbar--chart .pdl-analytics-card__title {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 38%;
  margin-right: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdl-analytics-card__toolbar--chart .pdl-analytics-card__toolbar-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.375rem 0.5rem;
  min-width: 0;
  flex: 1 1 auto;
  margin-left: 0;
}

.pdl-analytics-card__toolbar--chart .pdl-analytics-card__actions {
  flex-wrap: nowrap;
  margin-left: 0;
  flex-shrink: 0;
}

.pdl-analytics-card__toolbar--chart .pdl-chart-toggle {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.375rem;
  width: auto;
  flex-shrink: 0;
}

.pdl-chart-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

@media (max-width: 639px) {
  .pdl-analytics-card__toolbar--chart {
    flex-wrap: wrap;
  }

  .pdl-analytics-card__toolbar--chart .pdl-analytics-card__toolbar-row {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
  }
}

/* Custom checkbox — clear checked / unchecked (chart toolbars) */
.pdl-legend-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--pdl-color-muted);
}

.pdl-legend-toggle:hover .pdl-legend-toggle__text {
  color: var(--pdl-color-text);
}

.pdl-legend-toggle__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pdl-legend-toggle__box {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--pdl-color-border);
  border-radius: 4px;
  background: var(--pdl-color-white);
  box-sizing: border-box;
  position: relative;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pdl-legend-toggle__input:checked + .pdl-legend-toggle__box {
  background: var(--pdl-color-brand);
  border-color: var(--pdl-color-brand);
  box-shadow: 0 0 0 1px var(--pdl-color-brand);
}

.pdl-legend-toggle__input:checked + .pdl-legend-toggle__box::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--pdl-color-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.pdl-legend-toggle__input:focus-visible + .pdl-legend-toggle__box {
  outline: 2px solid color-mix(in srgb, var(--pdl-color-brand) 45%, transparent);
  outline-offset: 2px;
}

.pdl-legend-toggle__input:checked ~ .pdl-legend-toggle__text {
  color: var(--pdl-color-brand-dark);
  font-weight: 500;
}

.pdl-input-narrow {
  width: 4.5rem;
  min-width: 4.5rem;
  text-align: center;
}

.pdl-chart-top-input {
  width: 2.5rem;
  min-width: 2.5rem;
  max-width: 2.75rem;
  padding: 0.3rem 0.2rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  -moz-appearance: textfield;
}

.pdl-chart-top-input::-webkit-outer-spin-button,
.pdl-chart-top-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pdl-chart-type-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

.pdl-chart-type-toggle .kt-btn.kt-btn-icon {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  padding: 0;
  flex-grow: 0;
  border-radius: var(--radius-md, 0.375rem);
}

.pdl-chart-type-toggle .kt-btn.kt-btn-icon i.ki-filled {
  width: var(--pdl-action-icon-size);
  height: var(--pdl-action-icon-size);
  font-size: var(--pdl-action-icon-size);
  line-height: 1;
}

.pdl-chart-type-toggle .pdl-chart-type-btn.kt-btn-outline {
  background: var(--pdl-color-white) !important;
  border-color: var(--pdl-color-chip-border) !important;
  color: var(--pdl-color-chip-text) !important;
}

.pdl-chart-type-toggle .pdl-chart-type-btn.kt-btn-primary {
  background: var(--pdl-color-selection-bg) !important;
  border-color: var(--pdl-color-selection-bg) !important;
  color: var(--pdl-color-selection-text) !important;
}

.pdl-chart-type-toggle .pdl-chart-type-btn.active {
  z-index: 1;
}

.pdl-chart-box.graph {
  width: 100%;
  min-height: 380px;
  height: 380px;
}

.pdl-chart-box-host {
  width: 100%;
  min-height: 380px;
}

.pdl-analytics-card__title--with-expand {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
}

.pdl-analytics-card__title--with-expand .pdl-analytics-card__title-link {
  min-width: 0;
}

.pdl-chart-expand-btn {
  flex-shrink: 0;
  opacity: 0.72;
}

.pdl-chart-expand-btn:hover,
.pdl-chart-expand-btn:focus-visible {
  opacity: 1;
}

.pdl-chart-expand-modal .kt-modal-content,
.pdl-chart-expand-modal__content {
  width: 80vw;
  max-width: 80vw;
  height: 80vh;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.pdl-chart-expand-panel {
  min-width: 0;
  flex: 1 1 auto;
}

.pdl-chart-expand-modal__panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: 0.75rem;
}

.pdl-chart-expand-modal__panel .pdl-chart-expand-panel {
  flex: 0 0 auto;
  width: 100%;
}

.pdl-chart-expand-modal__panel .pdl-analytics-card__toolbar-row {
  width: 100%;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.5rem 0.75rem;
}

.pdl-chart-expand-modal__panel .pdl-chart-box-host {
  flex: 1 1 auto;
  min-height: 0;
}

.pdl-chart-card--expanded-open .pdl-analytics-card__toolbar--chart {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.pdl-chart-expand-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 1rem 1.25rem 1.25rem;
}

.pdl-chart-box--expanded {
  width: 100%;
  min-height: 100%;
  height: auto !important;
}

body.pdl-chart-expand-modal-open {
  overflow: hidden;
}

#pdlChartExpandModal.open {
  display: flex;
}

@media (max-width: 767px) {
  .pdl-chart-expand-modal .kt-modal-content,
  .pdl-chart-expand-modal__content {
    width: 94vw;
    max-width: 94vw;
    height: 88vh;
    max-height: 88vh;
  }
}

.pdl-table-wrap {
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

/* Top Songs — KTUI datatable layout (basic usage, no search) */
.pdl-top-songs-datatable .pdl-analytics-card__toolbar--table {
  margin-bottom: 0;
  padding-bottom: 10px;
  border-bottom: none;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.pdl-top-songs-datatable .pdl-analytics-card__toolbar--table .pdl-analytics-card__title {
  flex: 0 1 auto;
  min-width: 0;
}

.pdl-top-songs-datatable .pdl-analytics-card__toolbar--table .pdl-analytics-card__actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  margin-left: auto;
}

.pdl-top-trends-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}

.pdl-top-trends-header__row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  width: 100%;
  min-height: 36px;
}

.pdl-top-trends-header__start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.pdl-top-trends-header__title {
  margin: 0;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 600;
}

.pdl-top-trends-header__platform-name {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0 0.5rem;
  max-width: min(42vw, 20rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--pdl-color-brand-dark);
  letter-spacing: -0.02em;
  text-align: center;
  pointer-events: none;
}

/* Top trends DSP row — match Recent Streaming Trends (#dashboard_btns) */
#spotify_trends_platform_icons.pdl-segmented-control--platforms {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  align-self: center;
  max-width: none;
  width: max-content;
  border: 1px solid var(--pdl-color-border);
  border-radius: 9999px;
  overflow: hidden;
  background: var(--pdl-color-white);
  padding: 0;
}

#spotify_trends_platform_icons > .pdl-segment-btn {
  border: none;
  background: transparent;
  padding: 8px 18px;
  font-family: var(--pdl-font);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25;
  color: var(--pdl-color-muted);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transform: none;
  min-height: 0;
  margin: 0;
}

#spotify_trends_platform_icons > .pdl-segment-btn:not(:last-child) {
  border-right: 1px solid var(--pdl-color-border);
}

#spotify_trends_platform_icons > .pdl-segment-btn:hover:not(:disabled) {
  background: var(--pdl-color-brand-hover-soft);
  color: var(--pdl-color-brand-dark);
}

#spotify_trends_platform_icons > .pdl-segment-btn.active {
  background: var(--pdl-color-brand-soft);
  color: var(--pdl-color-brand-dark);
}

#spotify_trends_platform_icons > .pdl-segment-btn--platform.pdl-platform-btn {
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  padding: 6px;
  font-size: 0;
  line-height: 0;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow: hidden;
  min-height: 36px;
}

#spotify_trends_platform_icons > .pdl-segment-btn--platform.pdl-platform-btn img,
#spotify_trends_platform_icons > .pdl-segment-btn--platform.pdl-platform-btn .pdl-platform-icon-mount,
#spotify_trends_platform_icons > .pdl-segment-btn--platform.pdl-platform-btn .pdl-platform-icon-mount svg,
#spotify_trends_platform_icons > .pdl-segment-btn--platform.pdl-platform-btn .pdl-platform-sprite-icon {
  display: block;
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  object-fit: contain;
  pointer-events: none;
  flex-shrink: 0;
}

#spotify_trends_platform_icons > .pdl-segment-btn--platform.pdl-platform-btn .pdl-platform-icon-mount {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

#spotify_trends_platform_icons > .pdl-segment-btn--platform.pdl-platform-btn.active {
  background: var(--pdl-color-brand-soft);
  color: var(--pdl-color-brand-dark);
  border-color: var(--pdl-color-brand-soft);
  box-shadow: 0 0 0 1px var(--pdl-color-brand-soft);
}

.pdl-top-songs-actions {
  gap: 0.4rem 0.5rem;
  flex-wrap: nowrap;
}

.pdl-top-songs-actions__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--pdl-color-text-muted, #64748b);
  white-space: nowrap;
}

.pdl-top-songs-count-input {
  width: 2.75rem;
  min-width: 2.75rem;
  max-width: 3rem;
  padding: 0.3rem 0.25rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  -moz-appearance: textfield;
}

/* Meta — Daily play report (isrcdownload) — single toolbar row */
#pdl_isrcdownload_page {
  --pdl-isrcdownload-control-h: 2.5rem;
  --pdl-isrcdownload-radius: var(--pdl-radius-chip, 8px);
}

.pdl-isrcdownload-card {
  border: 1px solid var(--pdl-color-border-soft);
}

.pdl-isrcdownload-card .kt-card-body {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.pdl-isrcdownload-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-width: 0;
}

.pdl-isrcdownload-toolbar__main {
  display: flex;
  flex: 1;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  min-width: 0;
}

.pdl-isrcdownload-field {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 0;
}

.pdl-isrcdownload-field--inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.pdl-isrcdownload-field__prompt {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pdl-color-text-secondary, #475569);
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Songwise | Label — chip shell (matches platform + month on this page) */
#pdl_isrcdownload_page .pdl-isrcdownload-segmented.pdl-segmented-control {
  display: inline-flex;
  flex-shrink: 0;
  align-items: stretch;
  border: 1px solid var(--pdl-color-border);
  min-height: var(--pdl-isrcdownload-control-h);
  height: var(--pdl-isrcdownload-control-h);
  border-radius: var(--pdl-isrcdownload-radius);
  overflow: hidden;
  background: var(--pdl-color-white);
  padding: 0;
}

#pdl_isrcdownload_page .pdl-isrcdownload-segmented .pdl-segment-btn {
  border: none;
  background: transparent;
  min-height: 0;
  height: 100%;
  padding: 0 1rem;
  font-family: var(--pdl-font);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25;
  color: var(--pdl-color-muted);
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#pdl_isrcdownload_page .pdl-isrcdownload-segmented .pdl-segment-btn:not(:last-child) {
  border-right: 1px solid var(--pdl-color-border);
}

#pdl_isrcdownload_page .pdl-isrcdownload-segmented .pdl-segment-btn:hover:not(:disabled) {
  background: var(--pdl-color-brand-hover-soft);
  color: var(--pdl-color-brand-dark);
}

#pdl_isrcdownload_page .pdl-isrcdownload-segmented .pdl-segment-btn.active {
  background: var(--pdl-color-brand-soft);
  color: var(--pdl-color-brand-dark);
}

.pdl-isrcdownload-label-field {
  display: flex;
  align-items: stretch;
  width: 12rem;
  min-width: 12rem;
  min-height: var(--pdl-isrcdownload-control-h);
  border: 1px solid var(--pdl-color-border-soft, #e2e8f0);
  border-radius: var(--pdl-isrcdownload-radius);
  background: var(--pdl-color-white, #fff);
  overflow: hidden;
}

.pdl-isrcdownload-label-field__input {
  flex: 1 1 auto;
  min-width: 0;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  min-height: var(--pdl-isrcdownload-control-h);
  height: var(--pdl-isrcdownload-control-h);
  font-size: 0.875rem;
}

.pdl-isrcdownload-label-field__suggest {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--pdl-color-text-muted, #64748b);
  white-space: nowrap;
  border-left: 1px solid var(--pdl-color-border-soft);
  background: var(--pdl-color-surface-soft, #f8fafc);
  cursor: pointer;
}

/* Filter toolbars — shared single platform picker (isrcdownload, process report, meta-search) */
#pdl_isrcdownload_page .pdl-isrcdownload-field--platform div[data-size]:has(> .pdl-platform-dropdown),
#process_report_toolbar .pdl-report-field--platform div[data-size]:has(> .pdl-platform-dropdown),
.pdl-meta-search-toolbar div[data-size]:has(> .pdl-platform-dropdown):not(.is-multi):not(.is-language) {
  display: block;
  width: var(--pdl-picker-width-platform);
  min-width: var(--pdl-picker-width-platform);
  max-width: var(--pdl-picker-width-platform);
}

#pdl_isrcdownload_page .pdl-isrcdownload-field--platform .pdl-platform-input,
#pdl_isrcdownload_page .pdl-isrcdownload-field--platform .kt-input.pdl-platform-picker,
#pdl_isrcdownload_page .pdl-isrcdownload-field--platform div[data-size]:has(> .pdl-platform-dropdown)[data-size="md"]:not(.is-language) .pdl-platform-input,
#pdl_isrcdownload_page .pdl-isrcdownload-field--platform div[data-size]:has(> .pdl-platform-dropdown)[data-size="md"]:not(.is-language) input.kt-input.pdl-platform-picker,
#process_report_toolbar .pdl-report-field--platform .pdl-platform-input,
#process_report_toolbar .pdl-report-field--platform .kt-input.pdl-platform-picker,
#process_report_toolbar .pdl-report-field--platform div[data-size]:has(> .pdl-platform-dropdown)[data-size="md"]:not(.is-language) .pdl-platform-input,
#process_report_toolbar .pdl-report-field--platform div[data-size]:has(> .pdl-platform-dropdown)[data-size="md"]:not(.is-language) input.kt-input.pdl-platform-picker,
.pdl-meta-search-toolbar div[data-size]:has(> .pdl-platform-dropdown):not(.is-multi):not(.is-language) .pdl-platform-input,
.pdl-meta-search-toolbar div[data-size]:has(> .pdl-platform-dropdown):not(.is-multi):not(.is-language) input.kt-input.pdl-platform-picker,
.pdl-meta-search-toolbar div[data-size]:has(> .pdl-platform-dropdown):not(.is-multi):not(.is-language) input.kt-input.pdl-platform-input {
  width: 100%;
  min-height: var(--pdl-filter-control-height, 2.5rem);
  height: var(--pdl-filter-control-height, 2.5rem);
  border-radius: var(--pdl-radius-chip, 8px);
  font-size: 0.875rem;
  line-height: 1.25;
  box-sizing: border-box;
  padding-block: 0;
  padding-inline-start: 2.75rem;
  padding-inline-end: 0.75rem;
}

#pdl_isrcdownload_page .pdl-isrcdownload-field--month .pdl-myp-wrap {
  width: var(--pdl-picker-width-month);
  min-width: var(--pdl-picker-width-month);
  max-width: var(--pdl-picker-width-month);
}

#pdl_isrcdownload_page .pdl-isrcdownload-field--month .pdl-myp-trigger,
#pdl_isrcdownload_page .pdl-isrcdownload-field--month .pdl-myp-wrap[data-size="md"] .pdl-myp-trigger,
#pdl_isrcdownload_page .pdl-isrcdownload-field--month .kt-input.pdl-month-year-picker {
  width: auto;
  min-height: var(--pdl-isrcdownload-control-h);
  height: auto;
  border-radius: var(--pdl-isrcdownload-radius);
  font-size: 0.875rem;
  line-height: 1.25;
  box-sizing: border-box;
  padding: 0 0.45rem;
}

.pdl-isrcdownload-actions {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

.pdl-isrcdownload-reset,
.pdl-isrcdownload-submit {
  min-height: var(--pdl-isrcdownload-control-h);
  height: var(--pdl-isrcdownload-control-h);
  white-space: nowrap;
}

/* Label picker inside admin field — match control shell */
.pdl-isrcdownload-label-field .pdl-label-picker.pdl-sign-in-field {
  min-height: var(--pdl-isrcdownload-control-h);
  height: 100%;
  border-radius: 0;
  border: none;
}

@media (max-width: 991px) {
  .pdl-isrcdownload-toolbar {
    flex-wrap: wrap;
  }

  .pdl-isrcdownload-toolbar__main {
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
    padding-right: 0;
  }

  .pdl-isrcdownload-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* L1/L2 admin listing — unified search toolbar */
.pdl-l1l2-search-card,
.pdl-form-card {
  border: 1px solid var(--pdl-color-border-soft);
}

/* Admin filter / form sections (standard Metronic card shell) */
.pdl-form-card .kt-card-body table td {
  padding: 0.25rem 0.5rem 0.25rem 0;
  vertical-align: middle;
}

/* Metronic kt-switch — keep compat layer from flattening toggle controls */
.pdl-form-card .kt-switch {
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background-color: var(--input, var(--pdl-color-border-soft));
}

.pdl-form-card .kt-switch:checked {
  background-color: var(--primary, var(--pdl-color-brand));
}

/* Filter switch — outer gray pad + outer stroke; inner pill keeps its own border */
.pdl-filter-switch-outer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0.1875rem 0.3125rem;
  line-height: 0;
  background-color: var(--input, var(--pdl-color-border-soft, #e2e8f0));
  border: 1px solid var(--pdl-color-border, #cbd5e1);
  border-radius: 0.25rem;
  box-sizing: border-box;
}

.pdl-filter-switch-outer:has(.pdl-filter-switch:checked),
.pdl-filter-switch-outer:has(.pdl-filter-switch[aria-checked="true"]) {
  background-color: var(--input, var(--pdl-color-border-soft, #e2e8f0));
  border-color: var(--pdl-color-border, #cbd5e1);
}

/* Compact filter-row switches — fixed track + thumb travel (not stretched by pdl-form-input) */
.pdl-filter-switch.kt-switch {
  flex-shrink: 0;
  min-width: 0 !important;
  width: 1.5rem !important;
  height: 0.875rem !important;
  padding: 0 !important;
  border: 1px solid var(--pdl-color-border, #cbd5e1) !important;
  border-radius: 9999px !important;
  box-sizing: border-box !important;
  position: relative;
  appearance: none;
  cursor: pointer;
  background-color: var(--input, var(--pdl-color-border-soft));
}

.pdl-filter-switch.kt-switch:checked,
.pdl-filter-switch.kt-switch[aria-checked="true"] {
  background-color: var(--primary, var(--pdl-color-brand));
  border-color: var(--pdl-color-border, #cbd5e1) !important;
}

.pdl-filter-switch.kt-switch::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  /* Fixed inset — avoid Metronic top:50% + translateY stacking (thumb rode too high) */
  top: calc((100% - 0.625rem) / 2) !important;
  bottom: auto !important;
  inset-inline-start: 0.125rem !important;
  left: 0.125rem !important;
  width: 0.625rem !important;
  height: 0.625rem !important;
  margin: 0 !important;
  border-radius: 9999px !important;
  background-color: #fff !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12) !important;
  --tw-translate-x: 0 !important;
  --tw-translate-y: 0 !important;
  transform: none !important;
  translate: none !important;
  transition: transform 0.15s ease !important;
  pointer-events: none;
}

.pdl-filter-switch.kt-switch:checked::before,
.pdl-filter-switch.kt-switch[aria-checked="true"]::before {
  /* Track 1.5rem − thumb 0.625rem − inset 0.125rem × 2 = 0.625rem travel */
  transform: translateX(0.625rem) !important;
  translate: none !important;
}

.pdl-meta-search-field--switch {
  min-width: 0 !important;
  flex: 0 0 auto;
}

.pdl-form-card .kt-card-body .kt-input,
.pdl-form-card .kt-card-body select.kt-input {
  min-height: 2.375rem;
}

.pdl-form-card .kt-card-body .kt-btn-sm,
.pdl-form-card .kt-card-body input.kt-btn-sm {
  min-height: 2.375rem;
}

.pdl-form-card .kt-card-header + .kt-card-body {
  padding-top: 1rem;
}

.pdl-l1l2-search-card__limit {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
}

/* L1/L2 search — row 1: search + months + page size + actions; row 2: position + type */
.pdl-l1l2-search-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
}

.pdl-l1l2-search-toolbar__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.pdl-l1l2-search-toolbar__row--secondary {
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.pdl-l1l2-search-toolbar__main {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.pdl-l1l2-search-toolbar__field--inline {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  min-width: 0;
}

.pdl-l1l2-search-toolbar__prompt {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pdl-color-text-secondary, #475569);
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

.pdl-l1l2-search-toolbar__field--search {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.pdl-l1l2-search-toolbar__field--search .pdl-l1l2-unified-search__field {
  flex: 1 1 auto;
  min-width: 8rem;
}

.pdl-l1l2-search-toolbar__field--month .pdl-myp-wrap {
  width: var(--pdl-picker-width-month);
  min-width: var(--pdl-picker-width-month);
  max-width: var(--pdl-picker-width-month);
}

.pdl-l1l2-search-toolbar__field--month .pdl-myp-trigger,
.pdl-l1l2-search-toolbar__field--month .kt-input.pdl-month-year-picker {
  width: 100%;
  min-width: 0;
  min-height: 2.375rem;
  box-sizing: border-box;
}

.pdl-l1l2-search-toolbar__field--limit {
  gap: 0.35rem;
}

.pdl-l1l2-search-toolbar__limit-text {
  font-size: 0.8125rem;
  color: var(--pdl-color-text-muted, #64748b);
  white-space: nowrap;
}

.pdl-l1l2-search-toolbar__radio-group {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.65rem;
}

.pdl-l1l2-search-toolbar__radio {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.8125rem;
  white-space: nowrap;
  cursor: pointer;
}

.pdl-l1l2-search-toolbar__actions {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.pdl-l1l2-unified-search__label,
.pdl-l1l2-filters__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pdl-color-text-muted, #64748b);
}

.pdl-l1l2-search-toolbar__field--search .pdl-l1l2-unified-search__field {
  flex-wrap: nowrap;
}

.pdl-l1l2-search-toolbar__field--search .pdl-l1l2-unified-search__field .pdl-label-picker.pdl-sign-in-field {
  min-width: 8rem;
}

.pdl-l1l2-unified-search__field {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0.5rem;
  border: 1px solid var(--pdl-color-border, #cbd5e1);
  border-radius: var(--pdl-radius-chip, 8px);
  background: var(--pdl-color-white, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.pdl-l1l2-unified-search__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.85rem;
  color: var(--pdl-color-brand, #7239b3);
  background: var(--pdl-color-surface-soft, #f8fafc);
  border-right: 1px solid var(--pdl-color-border-soft);
}

.pdl-l1l2-unified-search__input {
  flex: 1 1 12rem;
  min-width: 12rem;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.pdl-l1l2-unified-search__typeahead {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0 0.85rem;
  font-size: 0.8125rem;
  color: var(--pdl-color-text-muted, #64748b);
  white-space: nowrap;
  border-left: 1px solid var(--pdl-color-border-soft);
  background: var(--pdl-color-surface-soft, #f8fafc);
  cursor: pointer;
}

.pdl-l1l2-filters__field {
  min-width: 8.5rem;
}

/* My Sub Labels — single-row toolbar (meta search + l1report Go/Reset) */
#pdl_comp_search_toolbar.pdl-meta-search-toolbar {
  padding-left: 0;
  padding-right: 0;
}

#pdl_comp_search_toolbar .pdl-comp-search__status .kt-input {
  width: 11rem;
  min-width: 11rem;
  min-height: 2.375rem;
}

#pdl_comp_search_toolbar .pdl-meta-search-actions.l1report-toolbar-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

#pdl_comp_search_toolbar .l1report-toolbar-actions .kt-btn {
  min-height: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
}

.pdl-isrcdownload-actions.l1report-toolbar-actions {
  margin-left: auto;
}

.pdl-l1l2-filters__radios {
  min-width: auto;
}

.pdl-l1l2-filters__actions {
  margin-left: auto;
  align-self: flex-end;
}

@media (max-width: 1199px) {
  .pdl-l1l2-search-toolbar__row:not(.pdl-l1l2-search-toolbar__row--secondary) {
    flex-wrap: wrap;
  }

  .pdl-l1l2-search-toolbar__actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
}

.pdl-l1l2-listing-placeholder {
  border: 1px dashed var(--pdl-color-border-soft);
  border-radius: var(--pdl-radius-chip, 8px);
  background: var(--pdl-color-surface-soft, #f8fafc);
}

@media (max-width: 767px) {
  .pdl-l1l2-search-card__limit {
    width: 100%;
    margin-left: 0 !important;
  }

  .pdl-l1l2-filters__actions {
    width: 100%;
    margin-left: 0;
  }
}

.pdl-top-songs-count-input::-webkit-outer-spin-button,
.pdl-top-songs-count-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pdl-top-songs-datatable .pdl-top-songs-views {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.pdl-top-songs-datatable .pdl-top-songs-views--fetching .pdl-top-songs-variant {
  opacity: 0.38;
  transition: opacity 0.22s ease;
}

.pdl-top-songs-variant__label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pdl-color-text-muted, #64748b);
}

.pdl-top-songs-variant__hint {
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--pdl-color-text-muted, #94a3b8);
}

.pdl-top-songs-datatable .kt-card-table {
  margin: 0 -0.25rem;
  border: 1px solid var(--pdl-color-border-soft);
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--pdl-color-white);
}

.pdl-top-songs-variant--store .pdl-top-songs-store-body {
  position: relative;
}

.pdl-top-songs-store-list {
  gap: 0.625rem;
}

.pdl-top-songs-store-card > .kt-card-content {
  padding-block: 0.5rem;
  padding-inline: 0.5rem 1rem;
}

.pdl-top-songs-store-card__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  padding: 0;
  margin: 0;
  min-height: 0;
}

.pdl-top-songs-store-card__main {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  min-width: 0;
  flex: 1;
  height: 70px;
  overflow: hidden;
}

.pdl-top-songs-store-card__thumb {
  display: block;
  flex-shrink: 0;
  width: 90px;
  height: 70px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  line-height: 0;
  font-size: 0;
  background: color-mix(in srgb, var(--pdl-color-brand-soft, #f3e8ff) 55%, var(--pdl-color-white));
  box-shadow: none;
  overflow: hidden;
}

.pdl-top-songs-store-card__thumb img {
  width: 90px;
  height: 70px;
  max-height: 70px;
  object-fit: cover;
  display: block;
  vertical-align: top;
}

.pdl-top-songs-store-card__meta {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.pdl-top-songs-store-rank {
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  padding-top: 0.05rem;
  color: var(--pdl-color-text-muted, #64748b);
}

.pdl-top-songs-store-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
}

.pdl-top-songs-store-title {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--pdl-color-brand-dark, #7239b3);
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdl-top-songs-store-album {
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--pdl-color-text-muted, #64748b);
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdl-top-songs-store-card__stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.25rem;
  flex-shrink: 0;
  text-align: right;
  padding-top: 0.05rem;
}

.pdl-top-songs-store-plays {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--pdl-color-text, #1e293b);
}

.pdl-top-songs-store-isrc {
  font-size: 0.6875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--pdl-color-text-muted, #64748b);
}

.pdl-top-songs-store-card:hover {
  border-color: color-mix(in srgb, var(--pdl-color-brand, #7239b3) 25%, var(--pdl-color-border-soft));
}

.pdl-top-songs-datatable .kt-table-wrapper {
  border-bottom: 1px solid var(--pdl-color-border-soft);
}

.pdl-top-songs-datatable .pdl-top-songs-table-body {
  position: relative;
}

.pdl-top-songs-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: color-mix(in srgb, var(--pdl-color-white, #fff) 82%, transparent);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.pdl-top-songs-loading.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.pdl-top-songs-loading__spinner {
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid var(--pdl-color-border-soft, #e2e8f0);
  border-top-color: var(--pdl-color-brand, #7239b3);
  border-radius: 50%;
  animation: pdl-top-songs-spin 0.65s linear infinite;
}

.pdl-top-songs-loading__text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pdl-color-brand-dark, #5b21b6);
  letter-spacing: 0.02em;
}

@keyframes pdl-top-songs-spin {
  to {
    transform: rotate(360deg);
  }
}

.pdl-top-songs-datatable .pdl-top-songs-variant {
  transition: opacity 0.22s ease;
}

/* PDL data table headers — standard (exceptions: .l1report-data-table, .pdl-meta-active-table, .pdl-meta-listmeta-table) */
.pdl-dt-table thead th,
.pdl-top-songs-datatable .kt-table thead th,
.pdl-placement-datatable .kt-table thead th,
.pdl-datatable-shell .kt-table thead th {
  font-size: var(--pdl-dt-th-font-size);
  font-weight: var(--pdl-dt-th-font-weight);
  color: var(--pdl-dt-th-color);
  background: var(--pdl-dt-th-bg);
  border-bottom: 1px solid var(--pdl-dt-th-border);
  padding: var(--pdl-dt-th-padding-y) var(--pdl-dt-th-padding-x);
  vertical-align: middle;
  white-space: nowrap;
}

.pdl-dt-table .kt-table-col-sort,
.pdl-top-songs-datatable .kt-table-col-sort,
.pdl-placement-datatable .kt-table-col-sort,
.pdl-datatable-shell .kt-table-col-sort {
  display: none;
}

/* Numeric header/body alignment — pair with .pdl-dt-th--numeric / .pdl-dt-td--numeric */
.pdl-dt-table th.pdl-dt-th--numeric,
.pdl-dt-table td.pdl-dt-td--numeric,
.pdl-table-layout th.text-end,
.pdl-table-layout td.text-end {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

/* Few-column tables — narrow width instead of stretching full page */
.pdl-table-layout {
  width: 100%;
}

.pdl-table-layout--few-columns {
  width: fit-content;
  max-width: 100%;
}

.pdl-table-layout--few-columns .pdl-table-layout__card {
  display: inline-block;
  width: auto;
  max-width: 100%;
  min-width: min(100%, 18rem);
  margin: 0;
  border: 1px solid var(--pdl-color-border-soft, #e2e8f0);
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--pdl-color-white, #fff);
}

.pdl-table-layout--few-columns .pdl-table-layout__scroll {
  overflow-x: auto;
}

.pdl-table-layout--few-columns .kt-table {
  width: auto;
  min-width: 100%;
  table-layout: auto;
}

.pdl-table-layout--few-columns .pdl-dt-th--label,
.pdl-table-layout--few-columns .pdl-dt-td--label {
  text-align: left;
  min-width: 9rem;
}

.pdl-table-layout--few-columns .pdl-dt-th--numeric,
.pdl-table-layout--few-columns .pdl-dt-td--numeric {
  min-width: 6.5rem;
  padding-left: 1.25rem;
  white-space: nowrap;
}

.pdl-top-songs-datatable .pdl-top-songs-table__img img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid var(--pdl-color-border-soft);
  display: block;
}

.pdl-top-songs-datatable .pdl-top-songs-table__song {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.pdl-top-songs-datatable .pdl-top-songs-table__song strong {
  font-weight: 600;
  line-height: 1.35;
}

/* Footer: single row (KTUI stacks column below 40rem — too narrow inside analytics card) */
.pdl-top-songs-datatable .pdl-top-songs-datatable__footer.kt-datatable-toolbar {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3rem;
}

.pdl-top-songs-datatable .pdl-top-songs-datatable__length.kt-datatable-length {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.pdl-top-songs-datatable .pdl-top-songs-datatable__length-label,
.pdl-top-songs-datatable .pdl-top-songs-datatable__length-suffix {
  flex-shrink: 0;
  line-height: 1.25;
}

.pdl-top-songs-datatable .pdl-top-songs-datatable__length .pdl-top-songs-count-input {
  flex-shrink: 0;
}

.pdl-top-songs-datatable .pdl-top-songs-datatable__info.kt-datatable-info {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 1.25rem;
  margin-left: auto;
  min-width: 0;
}

.pdl-top-songs-datatable .pdl-top-songs-datatable__info-text,
.pdl-top-songs-datatable .pdl-top-songs-datatable__page-label {
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.pdl-top-songs-datatable .pdl-top-songs-datatable__page-label {
  font-size: 0.8125rem;
  color: var(--pdl-color-text-muted, #64748b);
}

.pdl-top-songs-datatable .pdl-top-songs-datatable__pagination.kt-datatable-pagination {
  flex-shrink: 0;
}

.pdl-top-songs-datatable .pdl-top-songs-datatable__pagination .kt-datatable-pagination-button {
  pointer-events: auto;
  cursor: pointer;
}

.pdl-top-songs-datatable .pdl-top-songs-datatable__pagination .kt-datatable-pagination-button[disabled] {
  pointer-events: none;
  opacity: 0.4;
  cursor: not-allowed;
}

.pdl-top-songs-datatable .pdl-top-songs-datatable__pagination .kt-datatable-pagination-button.active {
  font-weight: 600;
}

@media (max-width: 639px) {
  .pdl-top-songs-datatable .pdl-top-songs-datatable__footer.kt-datatable-toolbar {
    flex-wrap: wrap;
    row-gap: 0.75rem;
  }

  .pdl-top-songs-datatable .pdl-top-songs-datatable__info.kt-datatable-info {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }
}

/* Placement listings (Songs / Album) — dashboard-style datatable */
.pdl-placement-datatable .pdl-placement-platform {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.pdl-placement-datatable .pdl-placement-platform__icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.pdl-placement-datatable .pdl-placement-table__name strong {
  font-weight: 600;
  color: var(--pdl-color-text, #1e293b);
}

.pdl-placement-datatable .pdl-placement-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--pdl-color-brand, #7239b3);
  cursor: pointer;
  text-align: left;
  max-width: 100%;
}

.pdl-placement-datatable .pdl-placement-link:hover {
  text-decoration: underline;
}

/* Action icon glyphs — sized via --pdl-action-icon-size in :root */
.pdl-action-strip i,
.pdl-action-strip__icon--inactive i,
.pdl-placement-action i,
.pdl-chart-type-toggle .kt-btn.kt-btn-icon i {
  font-size: var(--pdl-action-icon-size);
  line-height: 1;
}

.pdl-action-strip i[class*="ki-"],
.pdl-action-strip__icon--inactive i[class*="ki-"],
.pdl-placement-action i[class*="ki-"],
.pdl-chart-type-toggle .kt-btn.kt-btn-icon i[class*="ki-"] {
  width: var(--pdl-action-icon-size);
  height: var(--pdl-action-icon-size);
}

/* Fixed-width action icon slots — empty slots keep alignment when icons are conditional */
.pdl-action-strip {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
}

.pdl-action-strip__slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--pdl-action-slot-size);
  height: var(--pdl-action-slot-size);
  flex: 0 0 var(--pdl-action-slot-size);
}

/* Inactive / skipped action icons — very faint, no pointer */
.pdl-action-strip__icon--inactive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--pdl-action-slot-size);
  height: var(--pdl-action-slot-size);
  cursor: default;
  pointer-events: none;
  opacity: 0.16;
  color: var(--color-muted-foreground, #9ca3af);
}

.pdl-action-strip__icon--inactive:hover {
  cursor: default;
}

.pdl-placement-datatable .pdl-placement-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pdl-placement-datatable .pdl-placement-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--pdl-radius-chip, 8px);
  color: var(--pdl-color-muted, #64748b);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pdl-placement-datatable .pdl-placement-action--btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.pdl-placement-datatable .pdl-placement-action:hover {
  background: var(--pdl-color-surface-soft, #f1f5f9);
  color: var(--pdl-color-brand, #7239b3);
}

.pdl-placement-datatable .pdl-placement-action--danger:hover {
  color: var(--pdl-color-danger, #dc2626);
}

.pdl-placement-datatable .pdl-placement-action--emailed {
  color: #ff8989;
}

.pdl-placement-datatable .pdl-placement-table-wrap {
  width: 100%;
}

.pdl-placement-datatable .pdl-placement-table-body {
  max-height: none;
}

.pdl-placement-datatable .pdl-placement-table td,
.pdl-placement-datatable .pdl-placement-table th {
  vertical-align: middle;
}

.pdl-placement-datatable .pdl-placement-table__img img {
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.pdl-placement-datatable .pdl-placement-table td:last-child {
  white-space: nowrap;
}

.pdl-placement-datatable .pdl-action-strip .pdl-placement-action--emailed,
.pdl-action-strip .pdl-placement-action--emailed {
  color: #ff8989;
}

/* Placement detail view — view_playlist / view_album */
.pdl-placement-view-card {
  border: 1px solid var(--pdl-color-border-soft, #e2e8f0);
}

.pdl-placement-view-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  margin: 0;
}

.pdl-placement-view-meta__item {
  min-width: 0;
}

.pdl-placement-view-meta__item--wide {
  grid-column: 1 / -1;
}

.pdl-placement-view-meta dt {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--pdl-color-text-muted, #64748b);
}

.pdl-placement-view-meta dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--pdl-color-text, #1d1b20);
  word-break: break-word;
}

.pdl-placement-view-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  border: 1px solid var(--pdl-color-border-soft, #e2e8f0);
}

.pdl-top-songs-store-card__thumb .pdl-store-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 70px;
  color: var(--pdl-color-brand, #7239b3);
}

.pdl-top-songs-store-card__stats .pdl-placement-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}


/* Meta listing — multi-column row layout */
.pdl-meta-listing-card .pdl-top-songs-store-card__main {
  height: auto;
  min-height: 70px;
  overflow: visible;
}

.pdl-meta-listing-cols {
  display: flex;
  flex: 1;
  gap: 0.75rem 1.25rem;
  min-width: 0;
  align-items: flex-start;
}

.pdl-meta-listing-col {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.pdl-meta-listing-col--labels {
  flex: 1 1 11rem;
  min-width: 9rem;
}

.pdl-meta-listing-col--song {
  flex: 2 1 14rem;
  min-width: 11rem;
}

.pdl-meta-listing-col--ids {
  flex: 0 0 10.25rem;
  width: 7.25rem;
  max-width: 9 rem;
}

.pdl-meta-listing-col--artists {
  flex: 1.5 1 3rem;
  min-width: 10rem;
}

.pdl-meta-listing-card .pdl-top-songs-store-card__stats {
  flex: 0 0 auto;
  align-self: stretch;
  justify-content: center;
  min-width: 4.75rem;
  padding-inline-start: 0.5rem;
}

.pdl-meta-listing-card .pdl-meta-listing-actions {
  flex-wrap: nowrap;
}

.pdl-meta-live-card .pdl-meta-listing-cols--live {
  gap: 0.5rem 0.65rem;
}

.pdl-meta-live-card .pdl-meta-listing-col--labels {
  flex: 0 1 8.5rem;
  min-width: 7rem;
  max-width: 9.5rem;
}

.pdl-meta-live-card .pdl-meta-listing-col--song {
  flex: 2.5 1 16rem;
  min-width: 12rem;
  max-width: 22rem;
}

.pdl-meta-live-card .pdl-meta-listing-col--artists {
  flex: 1 1 8rem;
  min-width: 7rem;
  max-width: 11rem;
}

.pdl-meta-live-card.pdl-meta-listing-card .pdl-top-songs-store-card__stats {
  flex: 0 1 auto;
  min-width: 4.5rem;
  align-items: flex-end;
  padding-inline-start: 0.65rem;
}

.pdl-meta-live-card {
  --pdl-meta-live-action-size: var(--pdl-action-slot-size);
  --pdl-meta-live-icon-size: var(--pdl-action-icon-size);
}

.pdl-meta-live-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  width: max-content;
  max-width: 100%;
}

.pdl-meta-live-actions__platforms,
.pdl-meta-live-actions__tools {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
}

.pdl-meta-live-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--pdl-meta-live-action-size);
  width: var(--pdl-meta-live-action-size);
  height: var(--pdl-meta-live-action-size);
  border-radius: 6px;
  color: var(--pdl-color-muted, #64748b);
  background: var(--pdl-color-surface-soft, #f1f5f9);
  transition: background-color 0.15s ease, color 0.15s ease;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.pdl-meta-live-action__icon {
  width: var(--pdl-meta-live-icon-size);
  height: var(--pdl-meta-live-icon-size);
  font-size: var(--pdl-meta-live-icon-size);
  line-height: 1;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.pdl-meta-live-action:hover {
  background: color-mix(in srgb, var(--pdl-color-brand, #7239b3) 12%, var(--pdl-color-surface-soft));
  color: var(--pdl-color-brand, #7239b3);
}

.pdl-meta-live-action--hot {
  color: var(--pdl-color-danger, #dc2626);
}

.pdl-meta-live-action--btn {
  font: inherit;
}

.pdl-meta-listing-line {
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--pdl-color-text, #1e293b);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Primary catalog entity title — event names, song names, etc. */
.pdl-catalog-title,
.pdl-meta-listing-line--song {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--pdl-color-brand-dark, #7239b3);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdl-meta-listing-line--prompt {
  color: var(--pdl-color-text-muted, #64748b);
}

.pdl-meta-listing-line__label {
  font-weight: 500;
  color: var(--pdl-color-text-muted, #64748b);
}

.pdl-event-listing-card .pdl-top-songs-store-card__main {
  height: auto;
  min-height: 0;
  overflow: visible;
  align-items: flex-start;
}

.pdl-event-listing-card .pdl-top-songs-store-card__inner {
  align-items: center;
  gap: 0.75rem 1rem;
}

.pdl-event-listing-card .pdl-top-songs-store-card__main {
  flex: 1 1 auto;
}

.pdl-event-listing-card .pdl-top-songs-store-card__meta {
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
}

.pdl-event-listing-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
  flex: 1 1 auto;
}

.pdl-event-listing-desc {
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--pdl-color-text-muted, #64748b);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdl-event-listing-tags {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  margin-top: 0.2rem;
  width: 100%;
}

.pdl-event-listing-card .pdl-catalog-tag-row {
  justify-content: flex-start;
  gap: 0.35rem 0.5rem;
}

.pdl-event-listing-card .pdl-catalog-tag-schedule {
  gap: 0.35rem;
}

.pdl-event-listing-card .pdl-top-songs-store-card__stats {
  flex: 0 0 auto;
  align-self: center;
  justify-content: center;
  min-width: 0;
  padding-inline-start: 0.25rem;
}

.pdl-catalog-tag-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem 0.75rem;
}

.pdl-catalog-tag-row--identity {
  min-height: 1.375rem;
}

.pdl-catalog-tag-row--schedule {
  min-height: 1.375rem;
}

.pdl-catalog-tag-schedule {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.pdl-catalog-tag-sep {
  color: var(--pdl-color-text-muted, #64748b);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  user-select: none;
}

.pdl-catalog-tag-slot {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  min-height: 1.375rem;
}

.pdl-catalog-tag-slot--type {
  width: 4.75rem;
}

.pdl-catalog-tag-slot--ownership {
  width: 5.75rem;
}

.pdl-catalog-tag-slot--status {
  width: 7.5rem;
}

.pdl-catalog-tag-slot--date {
  width: 10.75rem;
}

.pdl-catalog-tag-slot--meta {
  width: 5.25rem;
}

.pdl-catalog-tag {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdl-top-songs-store-card.pdl-event-row--own {
  border-color: color-mix(in srgb, #ffb4b4 60%, var(--pdl-color-border-soft));
  background: color-mix(in srgb, #ffb4b4 12%, var(--pdl-color-white));
}

.pdl-event-row--own {
  background: color-mix(in srgb, #ffb4b4 35%, transparent);
}

table.pdl-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

table.pdl-data-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--pdl-color-muted);
  background: var(--pdl-color-surface-soft);
  border-bottom: 1px solid var(--pdl-color-border-soft);
}

table.pdl-data-table td {
  padding: 10px 12px;
  vertical-align: top;
  border-bottom: 1px solid var(--pdl-color-border-soft);
  color: var(--pdl-color-text);
}

table.pdl-data-table tr:hover td {
  background: var(--pdl-color-brand-hover-soft);
}

.pdl-data-table__img img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--pdl-color-border-soft);
}

.pdl-data-table__song strong {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.pdl-data-table__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pdl-data-table__isrc {
  font-size: 0.8125rem;
  color: var(--pdl-color-muted);
  word-break: break-all;
}

/* Orphan legacy markup safety — hide stray empty cells outside data tables */
td:empty {
  display: none;
}

/* Data tables — keep column alignment when a cell has no value */
.kt-table td:empty,
.table td:empty {
  display: table-cell;
}

.kt-table td:empty::before,
.table td:empty::before {
  content: '\00a0';
}

/* --------------------------------------------------------------------------
   Authenticated content area (all modules under Metronic shell)
   -------------------------------------------------------------------------- */
#content .kt-container-fixed {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#content .row {
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}

#content [class*="col-"] {
  min-width: 0;
}

#content table {
  max-width: 100%;
}

#content pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: normal;
}

#content .subheader {
  margin-bottom: 1.25rem;
  border-radius: 0.75rem;
  background: var(--pdl-color-white);
  border: 1px solid var(--pdl-color-border-soft);
  box-shadow: 0 1px 3px var(--pdl-shadow-color-xs);
}

#content .subheader .container-fluid,
#content .subheader.bg-success {
  background: var(--pdl-color-white) !important;
  color: var(--pdl-color-text) !important;
  padding: 1rem 1.25rem;
}

#content .subheader h5,
#content .subheader .text-light {
  color: var(--pdl-color-brand-dark) !important;
  font-weight: 700;
}

#content .divclass,
#content .pdl-legacy-panel,
#content .kt-card.pdl-legacy-panel {
  border: 1px solid var(--pdl-color-border-soft);
  border-radius: 0.75rem;
  background: var(--pdl-color-surface);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px var(--pdl-shadow-color-xs);
}

#content .kt-alert {
  margin-bottom: 1rem;
  border-radius: 0.5rem;
}

/* Uniform notice bars — meta listing idle, l1 report, process pages */
.pdl-notice-bar-wrap {
  margin-bottom: 0;
}

.pdl-notice-bar-wrap--inset {
  padding: 1.25rem 1.25rem 0;
}

.pdl-notice-bar-wrap--spaced {
  margin-top: 1.25rem;
  margin-bottom: 1rem;
}

.pdl-notice-bar {
  display: block;
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
}

.pdl-notice-bar--info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.pdl-notice-bar--error {
  background: var(--pdl-color-danger-soft, #fceeee);
  border: 1px solid var(--pdl-color-danger-border, #f5c7c3);
  color: #991b1b;
}

.pdl-notice-bar--warning {
  background: var(--pdl-color-warning-soft, #fff8ec);
  border: 1px solid var(--pdl-color-warning-border, #f3dfcc);
  color: var(--pdl-color-warning-text, #6b4c2f);
}

/* Prominent “data fetched from …” banner — topsongs and similar reports */
.pdl-report-source-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 0.625rem;
  border: 1px solid color-mix(in srgb, var(--pdl-color-brand, #7c3aed) 30%, #93c5fd);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--pdl-color-brand, #7c3aed) 10%, #eff6ff) 0%,
    #f8fafc 100%
  );
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}


.pdl-report-source-banner__body {
  min-width: 0;
  flex: 1;
}

.pdl-report-source-banner__title {
  display: block;
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  color: #0f172a;
}

.pdl-report-source-banner__detail {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  color: #64748b;
}

.pdl-report-source-banner__item {
  display: block;
}

.pdl-report-source-banner__item + .pdl-report-source-banner__item {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed color-mix(in srgb, var(--pdl-color-brand, #7c3aed) 18%, #cbd5e1);
}

/* Datatable idle / empty notices — outside kt-card shell */
.pdl-datatable-shell-notices {
  margin-bottom: 1.25rem;
}

.pdl-datatable-shell-notices .pdl-notice-bar-wrap {
  margin-bottom: 0;
}

.pdl-datatable-shell-notices .pdl-notice-bar-wrap + .pdl-notice-bar-wrap {
  margin-top: 0.75rem;
}

.pdl-datatable-shell[hidden] {
  display: none !important;
}

.pdl-search-for-results-notice .kt-alert,
.pdl-notice-bar-wrap .kt-alert {
  margin-bottom: 0;
}

/* Standalone legacy kt-alert banners in content → same bar look */
#content div.kt-alert.kt-alert-info,
#content div.kt-alert.kt-alert-secondary {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-weight: 500;
  padding: 0.75rem 1rem;
  text-align: left;
}

#content div.kt-alert.kt-alert-destructive {
  background: var(--pdl-color-danger-soft, #fceeee);
  border: 1px solid var(--pdl-color-danger-border, #f5c7c3);
  color: #991b1b;
  font-weight: 500;
  padding: 0.75rem 1rem;
  text-align: left;
}

#content .kt-card:not(.pdl-legacy-panel) {
  margin-bottom: 1.25rem;
}

#content .kt-input,
#content select.kt-input,
#content textarea.kt-input {
  min-height: 2.375rem;
}

#content .kt-table.table {
  width: 100%;
  border-collapse: collapse;
}

#content .kt-table.table thead th {
  font-size: var(--pdl-dt-th-font-size);
  font-weight: var(--pdl-dt-th-font-weight);
  color: var(--pdl-dt-th-color);
  background: var(--pdl-dt-th-bg);
  border-bottom: 1px solid var(--pdl-dt-th-border);
  padding: var(--pdl-dt-th-padding-y) var(--pdl-dt-th-padding-x);
}

#content .kt-table.table tbody td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--pdl-color-border-soft);
  vertical-align: top;
}

/* Company listing — action icons must stay clickable (Metronic table styles) */
#company_listing .pdl-company-listing-table td a,
#company_listing .table td a {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  cursor: pointer;
  display: inline-block;
  padding: 0.15rem 0.35rem;
  vertical-align: middle;
}

#company_listing .pdl-company-listing-table td a i,
#company_listing .table td a i {
  pointer-events: none;
}

#company_listing .user__changeUser--disabled {
  cursor: pointer;
}

#content .alert:not(.kt-alert) {
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

#content #showTable table,
#content table.pdl-data-table {
  width: 100%;
}

/* Sign-in (login templates — Metronic only, no pdl-app-compat) */
html:has(body.pdl-sign-in-page) {
  height: 100%;
}

.pdl-sign-in-page {
  font-family: var(--pdl-font);
  color: #fff;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--pdl-vh, 100dvh);
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Same hero media treatment as https://pdlindia.org homepage */
.pdl-sign-in-media {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  height: 100dvh;
  height: var(--pdl-vh, 100dvh);
  z-index: 0;
  background: linear-gradient(135deg, #1a0a2e 0%, #4a1259 45%, #f10065 100%);
}

.pdl-sign-in-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdl-sign-in-media-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 8, 28, 0.55) 0%, rgba(15, 8, 28, 0.72) 55%, rgba(15, 8, 28, 0.88) 100%),
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(241, 0, 101, 0.18), transparent 70%);
  pointer-events: none;
}

.pdl-sign-in-layout {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--pdl-vh, 100dvh);
  display: flex;
  flex-direction: column;
}

.pdl-sign-in-main {
  flex: 1 1 auto;
  min-height: 0;
}

.pdl-sign-in-brand {
  padding: 2rem 1rem 0.5rem;
}

.pdl-sign-in-logo {
  max-width: 11rem;
  height: auto;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.35));
}

.pdl-sign-in-tagline {
  margin: 0.75rem 0 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

/* Login / recovery — floating alert above sign-in card */
.pdl-sign-in-card-wrap {
  position: relative;
  width: 100%;
}

.pdl-sign-in-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin: 0 0.75rem 0;
  padding: 0.875rem 1rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  box-shadow:
    0 8px 24px rgba(15, 23, 42, 0.16),
    0 2px 6px rgba(15, 23, 42, 0.08);
  position: relative;
  z-index: 2;
}

.pdl-sign-in-card-wrap .pdl-sign-in-alert + .pdl-sign-in-alert {
  margin-top: 0.5rem;
}

.pdl-sign-in-card-wrap .pdl-sign-in-alert:last-of-type {
  margin-bottom: -0.75rem;
}

.pdl-sign-in-alert__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  margin-top: 0.1rem;
  font-size: 1.125rem;
  line-height: 1;
}

.pdl-sign-in-alert__body {
  flex: 1;
  min-width: 0;
}

.pdl-sign-in-alert__body a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pdl-sign-in-alert--error {
  background: var(--pdl-color-danger-soft, #fceeee);
  border: 1px solid var(--pdl-color-danger-border, #f5c7c3);
  color: #7f1d1d;
}

.pdl-sign-in-alert--error .pdl-sign-in-alert__icon {
  color: var(--pdl-color-danger, #b3261e);
}

.pdl-sign-in-alert--warning {
  background: var(--pdl-color-warning-soft, #fff8ec);
  border: 1px solid var(--pdl-color-warning-border, #f3dfcc);
  color: var(--pdl-color-warning-text, #6b4c2f);
}

.pdl-sign-in-alert--warning .pdl-sign-in-alert__icon {
  color: var(--pdl-color-warning, #b17a00);
}

.pdl-sign-in-alert--success {
  background: var(--pdl-color-success-soft, #eaf8f1);
  border: 1px solid var(--pdl-color-success-border, #c8ead8);
  color: #166534;
}

.pdl-sign-in-alert--success .pdl-sign-in-alert__icon {
  color: var(--pdl-color-success, #1e8e5a);
}

.pdl-sign-in-alert--info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.pdl-sign-in-alert--info .pdl-sign-in-alert__icon {
  color: #2563eb;
}

.pdl-sign-in-alert--rich {
  font-size: 0.75rem;
  font-weight: 400;
}

.pdl-sign-in-card--has-alert .kt-card-header {
  padding-top: 1.35rem;
}

.pdl-sign-in-card {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 24px 48px rgba(33, 0, 93, 0.22),
    0 8px 16px rgba(241, 0, 101, 0.08);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.pdl-sign-in-card .kt-card-header,
.pdl-sign-in-card .kt-card-body {
  padding-inline: 1.75rem;
}

.pdl-sign-in-card .kt-card-header {
  padding-top: 1.75rem;
  padding-bottom: 0.5rem;
}

.pdl-sign-in-card .kt-card-body {
  padding-top: 0.75rem;
  padding-bottom: 1.75rem;
}

.pdl-sign-in-card-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pdl-color-brand-dark);
  letter-spacing: -0.02em;
}

.pdl-sign-in-card-subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: var(--pdl-color-muted);
  line-height: 1.45;
}

.pdl-sign-in-field {
  display: flex;
  align-items: stretch;
  border-radius: 0.5rem;
  border: 1px solid color-mix(in srgb, var(--pdl-color-outline) 22%, var(--pdl-color-border));
  background: var(--pdl-color-white);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(33, 0, 93, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pdl-sign-in-field:hover:not(:focus-within) {
  border-color: color-mix(in srgb, var(--pdl-color-brand) 35%, var(--pdl-color-border));
  box-shadow: 0 1px 3px rgba(33, 0, 93, 0.06);
}

.pdl-sign-in-field:focus-within {
  border-color: var(--pdl-color-brand);
  box-shadow:
    0 0 0 3px var(--pdl-color-brand-overlay-12),
    0 1px 2px rgba(33, 0, 93, 0.06);
}

.pdl-sign-in-field-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  flex-shrink: 0;
  color: var(--pdl-color-brand);
  background: var(--pdl-color-surface-soft);
  border-inline-end: 1px solid var(--pdl-color-border-soft);
  font-size: 0.9rem;
}

.pdl-sign-in-input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding-block: 0.65rem;
}

.pdl-sign-in-field-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-inline-start: 1px solid var(--pdl-color-border-soft);
  background: var(--pdl-color-surface-soft);
  color: var(--pdl-color-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.pdl-sign-in-field-toggle:hover {
  color: var(--pdl-color-brand);
  background: var(--pdl-color-brand-hover-soft);
}

.pdl-sign-in-field-toggle:focus-visible {
  outline: 2px solid var(--pdl-color-brand);
  outline-offset: -2px;
}

.pdl-sign-in-field-icon .fas,
.pdl-sign-in-field-toggle .fas {
  display: inline-block;
  font-family: "Font Awesome 5 Free" !important;
  font-weight: 900;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.pdl-sign-in-captcha {
  display: flex;
  justify-content: center;
}

.pdl-sign-in-providers {
  margin-bottom: 0.25rem;
}

.pdl-sign-in-provider-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: 1px solid color-mix(in srgb, var(--pdl-color-outline) 22%, var(--pdl-color-border));
  background: var(--pdl-color-white);
  color: var(--pdl-color-brand-dark);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(33, 0, 93, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.pdl-sign-in-provider-btn:hover {
  background: var(--pdl-color-surface-soft);
  border-color: color-mix(in srgb, var(--pdl-color-brand) 35%, var(--pdl-color-border));
  box-shadow: 0 2px 6px rgba(33, 0, 93, 0.08);
  transform: translateY(-1px);
}

.pdl-sign-in-provider-btn i {
  font-size: 1.1rem;
  width: 1.25rem;
  text-align: center;
}

.pdl-sign-in-provider-google i { color: #ea4335; }
.pdl-sign-in-provider-facebook i { color: #1877f2; }
.pdl-sign-in-provider-apple i { color: #1d1d1f; }
.pdl-sign-in-provider-phone i { color: #059669; }

.pdl-sign-in-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0.25rem;
  color: var(--pdl-color-muted);
  font-size: 0.8125rem;
}

.pdl-sign-in-divider::before,
.pdl-sign-in-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--pdl-color-border-soft);
}

.pdl-sign-in-phone-panel {
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: var(--pdl-color-surface-soft);
  border: 1px solid var(--pdl-color-border-soft);
}

.pdl-sign-in-submit {
  padding-block: 0.7rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  background: linear-gradient(135deg, #f10065 0%, #a9218b 48%, #6750a4 100%) !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(241, 0, 101, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.pdl-sign-in-submit:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 24px rgba(241, 0, 101, 0.42);
  transform: translateY(-1px);
}

.pdl-sign-in-footer {
  padding: 1.25rem 1rem 1.75rem;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.78);
}

.pdl-sign-in-footer a {
  color: #ffb8dc;
  text-decoration: none;
  font-weight: 500;
}

.pdl-sign-in-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 767px) {
  .pdl-sign-in-brand {
    flex-shrink: 0;
    padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
    padding-bottom: 0.25rem;
  }

  .pdl-sign-in-logo {
    max-width: 9rem;
  }

  .pdl-sign-in-tagline {
    font-size: 0.9rem;
    margin-top: 0.5rem;
  }

  .pdl-sign-in-main {
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding-top: 0.5rem;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
  }

  .pdl-sign-in-card-wrap {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    max-width: none;
  }

  .pdl-sign-in-card {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  .pdl-sign-in-card .kt-card-header,
  .pdl-sign-in-card .kt-card-body {
    padding-inline: 1.25rem;
  }

  .pdl-sign-in-card .kt-card-header {
    flex-shrink: 0;
    padding-top: 1.25rem;
    padding-bottom: 0.5rem;
  }

  .pdl-sign-in-card .kt-card-body {
    flex: 1 1 auto;
    padding-top: 0.75rem;
    padding-bottom: 1.25rem;
  }

  .pdl-sign-in-footer {
    flex-shrink: 0;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }
}

/* KTUI modal surfaces */
#AdminModal .kt-modal-content,
#pdlLogoutModal .kt-modal-content {
  background: var(--pdl-color-white);
}

#AdminModal .kt-modal-header,
#AdminModal .kt-modal-footer,
#pdlLogoutModal .kt-modal-header,
#pdlLogoutModal .kt-modal-footer {
  padding: 1rem 1.25rem;
}

#AdminModal .kt-modal-body {
  padding: 1.25rem;
}

/* Shared hide helper (avoid relying on Tailwind .hidden on legacy pages) */
.pdl-is-hidden {
  display: none !important;
}

/* Process royalty / flash report — l1report-style toolbar + card list */
#process_report_toolbar.pdl-trends-toolbar--live {
  padding-left: 1rem;
  padding-right: 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

#process_report_toolbar .l1report-toolbar-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

#process_report_toolbar .l1report-toolbar-row--filters {
  overflow-x: auto;
  overflow-y: visible;
  align-items: flex-end;
}

.pdl-report-field--month,
.pdl-report-field--year {
  position: relative;
}

.pdl-report-field--month.is-picker-open,
.pdl-report-field--year.is-picker-open {
  z-index: 60;
}

#process_report_toolbar .l1report-toolbar-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  align-self: flex-end;
}

#process_report_toolbar .l1report-toolbar-actions .kt-btn {
  min-height: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
  white-space: nowrap;
  margin: 0;
  vertical-align: bottom;
}

.pdl-report-extra-toggle {
  gap: 0.5rem;
  padding-left: 0.65rem;
  padding-right: 0.85rem;
  border-color: var(--pdl-color-border-soft, #e2e8f0);
  color: var(--pdl-color-text, #1e293b);
  background: var(--pdl-color-white, #fff);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pdl-report-extra-toggle__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  border: 1.5px solid var(--pdl-color-border-soft, #cbd5e1);
  border-radius: 0.2rem;
  background: var(--pdl-color-white, #fff);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pdl-report-extra-toggle__check {
  font-size: 0.625rem;
  line-height: 1;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.12s ease, transform 0.12s ease;
  color: #fff;
}

.pdl-report-extra-toggle__label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
}

.pdl-report-extra-toggle.is-active {
  border-color: var(--pdl-color-brand, #7239b3);
  background: color-mix(in srgb, var(--pdl-color-brand-soft, #f3e8ff) 55%, var(--pdl-color-white));
  color: var(--pdl-color-brand-dark, #5b21b6);
}

.pdl-report-extra-toggle.is-active .pdl-report-extra-toggle__box {
  border-color: var(--pdl-color-brand, #7239b3);
  background: var(--pdl-color-brand, #7239b3);
}

.pdl-report-extra-toggle.is-active .pdl-report-extra-toggle__check {
  opacity: 1;
  transform: scale(1);
}

.pdl-report-extra-toggle:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--pdl-color-brand, #7239b3) 40%, var(--pdl-color-border-soft));
}

.pdl-report-extra-toggle.is-active:hover:not(:disabled) {
  background: color-mix(in srgb, var(--pdl-color-brand-soft, #f3e8ff) 70%, var(--pdl-color-white));
}

.pdl-report-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex-shrink: 0;
}

.pdl-report-field__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pdl-color-text-muted, #64748b);
  line-height: 1.2;
}

.pdl-report-field--month .pdl-report-picker,
.pdl-report-field--year .pdl-report-picker {
  width: var(--pdl-picker-width-month);
  min-width: var(--pdl-picker-width-month);
}

.pdl-report-field--year .pdl-report-picker {
  width: 6.75rem;
  min-width: 6.75rem;
}

.pdl-report-picker {
  position: relative;
}

.pdl-report-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--pdl-color-border-soft, #e2e8f0);
  border-radius: 0.375rem;
  background: var(--pdl-color-white);
  color: var(--pdl-color-text, #1e293b);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pdl-report-picker-trigger:hover {
  border-color: color-mix(in srgb, var(--pdl-color-brand, #7239b3) 30%, var(--pdl-color-border-soft));
}

.pdl-report-picker-trigger.is-open,
.pdl-report-picker-trigger:focus-visible {
  outline: none;
  border-color: var(--pdl-color-brand, #7239b3);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pdl-color-brand, #7239b3) 18%, transparent);
}

.pdl-report-picker-trigger__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.pdl-report-picker-trigger__text.is-placeholder {
  color: var(--pdl-color-text-muted, #64748b);
  font-weight: 400;
}

.pdl-report-picker-trigger__icon {
  flex-shrink: 0;
  font-size: 0.65rem;
  line-height: 1;
  color: var(--pdl-color-text-muted, #64748b);
}

.pdl-report-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 100;
  min-width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--pdl-color-border-soft);
  border-radius: 0.5rem;
  background: var(--pdl-color-white);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.pdl-report-popover.pdl-is-hidden {
  display: none !important;
}

.pdl-report-popover--portal {
  position: fixed;
  z-index: 10050;
}

.pdl-report-popover--open {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.pdl-report-picker-clear {
  width: 100%;
  margin-top: 0.5rem;
}

/* Dashboard / L1L2 trend chart — inset from card edges */
.pdl-trend-chart-area {
  padding: 0.5rem 1.25rem 1.25rem;
  box-sizing: border-box;
}

/* Apex title (SVG) — brand violet + bold; also applies on PNG/SVG export */
.pdl-trend-chart-area .apexcharts-title-text {
  font-weight: 700 !important;
  fill: var(--pdl-color-brand-dark, #5b21b6) !important;
}

.pdl-trend-chart-area__plot {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.pdl-trend-chart-area #chart_div,
.pdl-trend-chart-area #chart_div_v2,
.pdl-trend-chart-area canvas {
  display: block;
  max-width: 100%;
}


/* Dashboard trend chart — keep Apex line series visible */
.md-chart-area .apexcharts-line-series path.apexcharts-line,
.pdl-trend-chart-area .apexcharts-line-series path.apexcharts-line {
  stroke-width: inherit;
}

.pdl-report-month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}

.pdl-report-year-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

.pdl-report-month-btn,
.pdl-report-year-btn {
  min-height: 2rem;
  padding: 0.35rem 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid var(--pdl-color-border-soft);
  border-radius: 0.375rem;
  background: var(--pdl-color-white);
  color: var(--pdl-color-text, #1e293b);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pdl-report-month-btn:hover,
.pdl-report-year-btn:hover {
  border-color: color-mix(in srgb, var(--pdl-color-brand, #7239b3) 35%, var(--pdl-color-border-soft));
  background: color-mix(in srgb, var(--pdl-color-brand-soft, #f3e8ff) 45%, var(--pdl-color-white));
}

.pdl-report-month-btn.is-selected,
.pdl-report-year-btn.is-selected {
  border-color: var(--pdl-color-brand, #7239b3);
  background: var(--pdl-color-brand, #7239b3);
  color: #fff;
}

.pdl-process-report-views {
  position: relative;
  min-height: 6rem;
}

.pdl-report-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pdl-report-row-card > .pdl-report-row-card__inner,
.pdl-report-row-card .kt-card-content.pdl-report-row-card__inner {
  display: grid;
  grid-template-columns: auto 1fr minmax(3.5rem, 0.6fr) minmax(3.5rem, 0.5fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.65rem 1rem;
}

.pdl-report-row-card__inner {
  display: grid;
  grid-template-columns: auto 1fr minmax(3.5rem, 0.6fr) minmax(3.5rem, 0.5fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.65rem 1rem;
}

.pdl-report-row-card__logo-wrap {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  background: color-mix(in srgb, var(--pdl-color-brand-soft, #f3e8ff) 40%, var(--pdl-color-white));
}

.pdl-report-row-card__logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.pdl-report-row-card__name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--pdl-color-brand-dark, #7239b3);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdl-report-row-card__month,
.pdl-report-row-card__year {
  font-size: 0.875rem;
  color: var(--pdl-color-text, #1e293b);
  font-variant-numeric: tabular-nums;
}

.pdl-report-row-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.pdl-report-row-card__actions .summary_button {
  background-color: #349b9b;
  border-color: #349b9b;
  color: #fff;
}

.pdl-report-row-card:hover {
  border-color: color-mix(in srgb, var(--pdl-color-brand, #7239b3) 22%, var(--pdl-color-border-soft));
}

@media (max-width: 767px) {
  #process_report_toolbar .l1report-toolbar-row--filters {
    flex-wrap: wrap;
  }

  #process_report_toolbar .l1report-toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .pdl-report-row-card__inner {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
  }

  .pdl-report-row-card__month {
    grid-column: 2;
  }

  .pdl-report-row-card__year {
    grid-column: 3;
  }

  .pdl-report-row-card__actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* AJAX Go button — spinner + "Loading…" while request is in flight */
.kt-btn.is-loading {
  pointer-events: none;
  opacity: 0.72;
}

/* Required fields — red asterisk (legend + per-field marker) */
.pdl-form-required-legend {
  margin: 0;
  padding: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  font-weight: 500;
  color: var(--pdl-color-text-muted, #64748b);
}

.pdl-form-required-legend--start {
  flex: 1 1 100%;
  width: 100%;
  margin-bottom: 0.35rem;
}

.pdl-form-required-legend--below {
  flex: 0 0 auto;
  width: 100%;
  margin: 0.2rem 0 0;
}

.pdl-form-required-legend--above {
  flex: 0 0 auto;
  width: 100%;
  margin: 0 0 0.35rem;
}

.pdl-form-required-legend--before-actions,
.pdl-form-required-legend--end {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

.pdl-meta-search-toolbar--legend-below {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0.2rem var(--pdl-filter-field-gap, 0.65rem);
}

.pdl-meta-search-toolbar--legend-below .pdl-meta-search-toolbar__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--pdl-filter-field-gap, 0.65rem);
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.pdl-meta-search-toolbar--legend-below .pdl-meta-search-toolbar__row .pdl-meta-search-actions {
  margin-left: auto;
}

.pdl-form-required-legend__mark {
  color: var(--pdl-color-error, #b3261e);
  font-weight: 700;
}

.pdl-form-field,
.pdl-meta-search-toolbar .pdl-meta-search-field,
.pdl-myp-field {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  min-width: 0;
}

.pdl-myp-field__label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pdl-color-text-muted, #64748b);
}

.pdl-form-field__label--required::after,
.pdl-myp-field__label--required::after {
  content: " *";
  color: var(--pdl-color-error, #b3261e);
  font-weight: 700;
}

.pdl-form-field__required-mark,
.pdl-meta-search-field > .pdl-form-field__required-mark {
  color: var(--pdl-color-error, #b3261e);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}

.pdl-meta-search-field.pdl-form-field--required:not(:has(label)) > .pdl-form-field__required-mark,
.pdl-form-field.pdl-form-field--required:not(:has(label)) > .pdl-form-field__required-mark,
.pdl-myp-field.pdl-form-field--required:not(:has(.pdl-myp-field__label)) > .pdl-form-field__required-mark {
  display: inline;
}

.pdl-meta-search-field.pdl-form-field--invalid .kt-input,
.pdl-meta-search-field.pdl-form-field--invalid .pdl-myp-trigger,
.pdl-meta-search-field:has(:invalid) .kt-input,
.pdl-myp-field.pdl-form-field--invalid .pdl-myp-trigger,
.pdl-myp-field:has(:invalid) .pdl-myp-trigger,
.pdl-form-field.pdl-form-field--invalid .kt-input,
.pdl-form-field:has(:invalid) .kt-input {
  border-color: var(--pdl-color-error, #b3261e);
}

/* Top Songs report — report type segmented buttons (icon + label) */
#topsongs_toolbar .pdl-segmented-control {
  display: inline-flex;
  border: 1px solid var(--pdl-color-border);
  border-radius: 9999px;
  overflow: hidden;
  background: var(--pdl-color-white);
  padding: 0;
  flex-shrink: 0;
}

#topsongs_toolbar .pdl-segment-btn {
  border: none;
  background: transparent;
  padding: 8px 18px;
  font-family: var(--pdl-font);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25;
  color: var(--pdl-color-muted);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transform: none;
  min-height: 0;
}

#topsongs_toolbar .pdl-segment-btn:not(:last-child) {
  border-right: 1px solid var(--pdl-color-border);
}

#topsongs_toolbar .pdl-segment-btn:hover:not(:disabled) {
  background: var(--pdl-color-brand-hover-soft);
  color: var(--pdl-color-brand-dark);
}

#topsongs_toolbar .pdl-segment-btn.active {
  background: var(--pdl-color-brand-soft);
  color: var(--pdl-color-brand-dark);
}

#topsongs_toolbar .pdl-segment-btn--report-type {
  gap: 0.4rem;
  padding: 8px 12px;
  white-space: nowrap;
}

#topsongs_toolbar .pdl-segment-btn--report-type i {
  font-size: 0.9rem;
  color: var(--pdl-color-muted);
  flex-shrink: 0;
  line-height: 1;
}

#topsongs_toolbar .pdl-segment-btn--report-type.active i {
  color: var(--pdl-color-brand-dark);
}

#topsongs_toolbar .pdl-meta-search-field--report-type {
  flex-shrink: 0;
  overflow: visible;
}

/* Song events — catalogue row box + modal editor */
.pdl-event-tags-card .pdl-top-songs-store-card__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: start;
  gap: 0.65rem 0.75rem;
  min-width: 0;
}

.pdl-event-tags-card .pdl-top-songs-store-card__main {
  height: auto;
  min-height: 70px;
  overflow: hidden;
  align-items: flex-start;
  min-width: 0;
}

.pdl-event-tags-card .pdl-top-songs-store-card__meta {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.pdl-event-tags-card .pdl-meta-listing-cols--event-tags {
  display: grid;
  grid-template-columns: 8.75rem minmax(11rem, 1fr) 9.75rem;
  gap: 0.5rem 1rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.pdl-event-tags-card .pdl-meta-listing-col--labels {
  width: 8.75rem;
  max-width: 8.75rem;
}

.pdl-event-tags-card .pdl-meta-listing-col--song {
  min-width: 0;
}

.pdl-event-tags-card .pdl-meta-listing-col--artists {
  width: 9.75rem;
  max-width: 9.75rem;
}

.pdl-event-tags-card .pdl-meta-listing-col {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.pdl-event-tags-card .pdl-meta-listing-line--sublabel {
  font-weight: 600;
}

.pdl-event-tags-card > .kt-card-content {
  padding-inline-end: 0.5rem;
}

.pdl-event-tags-card .pdl-top-songs-store-card__stats {
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0;
  min-width: 0;
  width: calc(13rem + 2rem);
  max-width: calc(13rem + 2rem);
  flex-shrink: 0;
  padding-top: 0;
  align-self: flex-start;
}

.pdl-event-tags-aside {
  display: grid;
  grid-template-columns: 13rem 2rem;
  align-items: start;
  width: 100%;
  min-width: 0;
  column-gap: 0;
}

.pdl-event-tags-aside__events {
  min-width: 0;
}

.pdl-event-tags-aside__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.3rem;
  align-self: stretch;
  justify-self: end;
  padding-top: 0.05rem;
}

.pdl-song-events-box {
  display: flex;
  flex-direction: column;
  width: 13rem;
  min-width: 0;
  max-width: 13rem;
  flex-shrink: 1;
  border: 1px solid var(--pdl-color-border, #e2e8f0);
  border-radius: 0.375rem;
  overflow: hidden;
  background: var(--pdl-color-white, #fff);
}

.pdl-song-events-box--empty .pdl-song-events-box__body {
  min-height: 2rem;
}

.pdl-song-events-box__body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.35rem 0.5rem;
  max-height: 6.5rem;
  overflow: hidden;
}

.pdl-song-events-box__item {
  font-size: 0.6875rem;
  line-height: 1.35;
  font-weight: 500;
  color: var(--pdl-color-text, #1d1b20);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdl-song-events-box__empty {
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--pdl-color-text-muted, #64748b);
}

.pdl-song-events-box__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.5rem;
  border: none;
  border-top: 1px solid color-mix(in srgb, var(--pdl-color-brand, #6750a4) 80%, #000);
  background: var(--pdl-color-brand, #6750a4);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.pdl-song-events-box__footer:hover {
  background: var(--pdl-color-brand-dark, #4f378b);
}

.pdl-song-events-box__footer-count {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdl-song-events-box__footer-action {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
  font-weight: 700;
  white-space: nowrap;
}

.pdl-song-events-box__footer-action i {
  font-size: 0.625rem;
}

.pdl-song-events-modal {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

#AdminModal .kt-modal-header.pdl-admin-modal__header--song-events {
  gap: 0.75rem;
}

#AdminModal .kt-modal-header.pdl-admin-modal__header--song-events .pdl-song-events-modal__done {
  margin-inline-start: auto;
}

.pdl-song-events-modal__intro {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--pdl-color-border, #e2e8f0);
}

.pdl-song-events-modal__song,
.pdl-song-events-modal__album {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--pdl-color-text, #1d1b20);
}

.pdl-song-events-modal__label {
  display: inline-block;
  min-width: 3.25rem;
  margin-right: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pdl-color-text-muted, #64748b);
}

.pdl-song-events-modal__language {
  color: var(--pdl-color-text-muted, #64748b);
}

.pdl-song-events-modal__add-label,
.pdl-song-events-modal__list-title {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--pdl-color-text, #1d1b20);
}

.pdl-song-events-modal__picker.pdl-autocomplete-picker.pdl-sign-in-field {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.pdl-song-events-modal__list-wrap {
  display: flex;
  flex-direction: column;
}

.pdl-song-events-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--pdl-color-border, #e2e8f0);
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--pdl-color-surface, #fff);
}

.pdl-song-events-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--pdl-color-border-soft, #eef2f6);
  transition: opacity 0.22s ease, transform 0.22s ease, background-color 0.22s ease;
}

.pdl-song-events-list__item--removing {
  opacity: 0;
  transform: translateX(0.75rem);
  pointer-events: none;
  background-color: color-mix(in srgb, var(--destructive, #dc2626) 6%, transparent);
}

.pdl-song-events-list__item:last-child {
  border-bottom: none;
}

.pdl-song-events-list__name {
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--pdl-color-text, #1d1b20);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdl-song-events-list__remove {
  flex-shrink: 0;
}

.pdl-song-events-list__empty {
  padding: 0.875rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--pdl-color-text-muted, #64748b);
  text-align: center;
}

/* ── Standard picker entry widths (site-wide) — tokens on :root; overrides: PDL-UI-DESIGN.md ── */
.pdl-myp-wrap:not([data-granularity="date"]) {
  width: fit-content;
  min-width: 0;
  max-width: var(--pdl-picker-width-month);
  box-sizing: border-box;
}

.pdl-myp-wrap:not([data-granularity="date"]) .pdl-myp-trigger {
  width: auto;
  min-width: 0;
  box-sizing: border-box;
}

input.kt-input.pdl-date-picker,
.pdl-myp-wrap[data-granularity="date"] {
  width: var(--pdl-picker-width-date);
  min-width: var(--pdl-picker-width-date);
  max-width: var(--pdl-picker-width-date);
  box-sizing: border-box;
}

.pdl-myp-wrap[data-granularity="date"] .pdl-myp-trigger {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

div[data-size]:has(> .pdl-platform-dropdown):not(.is-multi):not(.is-language) {
  width: var(--pdl-picker-width-platform);
  min-width: var(--pdl-picker-width-platform);
  max-width: var(--pdl-picker-width-platform);
  box-sizing: border-box;
}

div[data-size]:has(> .pdl-platform-dropdown).is-multi:not(.is-language) {
  width: var(--pdl-picker-width-platform-multi);
  min-width: var(--pdl-picker-width-platform-multi);
  max-width: var(--pdl-picker-width-platform-multi);
  box-sizing: border-box;
}

div[data-size]:has(> .pdl-platform-dropdown).is-language.is-multi {
  width: var(--pdl-picker-width-language-multi);
  min-width: var(--pdl-picker-width-language-multi);
  max-width: var(--pdl-picker-width-language-multi);
  box-sizing: border-box;
}

div[data-size]:has(> .pdl-platform-dropdown) .pdl-platform-input,
div[data-size]:has(> .pdl-platform-dropdown) input.kt-input.pdl-platform-picker,
div[data-size]:has(> .pdl-platform-dropdown) input.kt-input.pdl-language-picker {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.pdl-autocomplete-picker.pdl-sign-in-field[data-picker-preset="language"],
.pdl-meta-search-field--lang.pdl-meta-search-field--picker .pdl-autocomplete-picker.pdl-sign-in-field {
  width: var(--pdl-picker-width-language);
  min-width: var(--pdl-picker-width-language);
  max-width: var(--pdl-picker-width-language);
  box-sizing: border-box;
}

/* Before platform-picker JS wraps the input */
input.kt-input.pdl-platform-picker:not(.pdl-platform-picker--multi):not(.pdl-language-picker) {
  width: var(--pdl-picker-width-platform);
  min-width: var(--pdl-picker-width-platform);
  max-width: var(--pdl-picker-width-platform);
  box-sizing: border-box;
}

input.kt-input.pdl-platform-picker--multi {
  width: var(--pdl-picker-width-platform-multi);
  min-width: var(--pdl-picker-width-platform-multi);
  max-width: var(--pdl-picker-width-platform-multi);
  box-sizing: border-box;
}

input.kt-input.pdl-language-picker--multi {
  width: var(--pdl-picker-width-language-multi);
  min-width: var(--pdl-picker-width-language-multi);
  max-width: var(--pdl-picker-width-language-multi);
  box-sizing: border-box;
}
