/* NeXOffers workspace design. Scope the visual refresh to admin/publisher panels;
   the shared theme controller, public site, email proofs and chart semantics remain independent. */
@font-face {
  font-family: "NeXOffers Sans";
  src: url("/fonts/Manrope/Manrope-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "NeXOffers Sans";
  src: url("/fonts/Manrope/Manrope-Medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "NeXOffers Sans";
  src: url("/fonts/Manrope/Manrope-SemiBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "NeXOffers Sans";
  src: url("/fonts/Manrope/Manrope-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "NeXOffers Sans";
  src: url("/fonts/Manrope/Manrope-ExtraBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

html:is([data-theme-page^="admin-"], [data-theme-page^="public-"]) {
  --panel-font:
    "NeXOffers Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --panel-radius: 16px;
  --panel-control-radius: 9px;
  --panel-card-shadow:
    0 2px 4px rgba(24, 24, 40, 0.025), 0 6px 20px rgba(24, 24, 40, 0.025);
  --panel-elevation: 0 12px 32px rgba(24, 24, 40, 0.09);
  --panel-gutter: clamp(20px, 2.2vw, 36px);
}
html[data-theme="light"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  ) {
  --theme-bg: #f6f7fa;
  --theme-raised: #f1f2f6;
  --theme-text: #202331;
  --theme-secondary: #474d60;
  --theme-muted: #606679;
  --theme-border: #d6d9e3;
  --theme-border-subtle: #e7e9f0;
  --theme-control-border: #858b9b;
  --theme-hover: #f0eff9;
  --theme-active: #eeecfc;
  --theme-primary: #5145cd;
  --theme-primary-hover: #4238ad;
  --theme-link: #4d40bd;
  --theme-link-hover: #382d98;
  --theme-focus: #5145cd;
  --theme-shadow: var(--panel-card-shadow);
  --theme-shadow-raised: var(--panel-elevation);
  --theme-focus-ring: 0 0 0 3px rgba(81, 69, 205, 0.18);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  ) {
  /* Dark workspace palette. These aliases also theme existing Bootstrap,
       page adapters, body-mounted overlays and the shared chart controller. */
  --bg-primary: #080b12;
  --bg-secondary: #0d111a;
  --surface-1: #101621;
  --surface-2: #131a27;
  --surface-hover: #181f2e;
  --surface-input: #0f1520;
  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-card: rgba(148, 163, 184, 0.1);
  --border-control: rgba(148, 163, 184, 0.58);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  /* #64748b is too faint for small helper text on elevated surfaces. */
  --text-subtle: #8795ab;
  --text-disabled: #475569;
  --accent: #635bff;
  --accent-hover: #6d5dfb;
  --accent-pressed: #5147dd;
  --accent-soft: rgba(99, 91, 255, 0.14);
  --accent-border: rgba(124, 108, 246, 0.32);
  --accent-text: #b5adff;
  --accent-text-hover: #d0caff;
  --panel-card-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  --panel-elevation: 0 16px 40px rgba(0, 0, 0, 0.32);
  --theme-bg: var(--bg-primary);
  --theme-navbar: var(--bg-secondary);
  --theme-surface: var(--surface-1);
  --theme-raised: var(--surface-2);
  --theme-input: var(--surface-input);
  --theme-text: var(--text-secondary);
  --theme-secondary: var(--text-secondary);
  --theme-muted: var(--text-muted);
  --theme-disabled: var(--text-disabled);
  --theme-border: var(--border-subtle);
  --theme-border-subtle: var(--border-card);
  --theme-control-border: var(--border-control);
  --theme-hover: var(--surface-hover);
  --theme-active: var(--accent-soft);
  --theme-primary: var(--accent);
  --theme-primary-hover: var(--accent-hover);
  --theme-on-primary: var(--text-primary);
  --theme-on-brand: var(--text-primary);
  --theme-link: var(--accent-text);
  --theme-link-hover: var(--accent-text-hover);
  --theme-focus: var(--accent);
  --theme-focus-ring: 0 0 0 3px rgba(99, 91, 255, 0.22);
  --theme-dropdown: var(--surface-2);
  --theme-modal: var(--surface-2);
  --theme-tooltip: var(--surface-hover);
  --theme-overlay: rgba(8, 11, 18, 0.72);
  --theme-shadow: var(--panel-card-shadow);
  --theme-shadow-raised: var(--panel-elevation);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"]) {
  --bg-main: var(--theme-bg);
  --card-bg: var(--theme-surface);
  --text-dark: var(--theme-text);
  /* --text-muted is the dark palette source, so never alias it back to
       --theme-muted in dark mode (that would create a variable cycle). */
  --border-color: var(--theme-border-subtle);
}
html[data-theme="light"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  ) {
  --text-muted: var(--theme-muted);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  body {
  font-family: var(--panel-font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  color: var(--theme-text);
  background: var(--theme-bg);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  :is(
    button,
    input,
    select,
    textarea,
    .btn,
    .form-control,
    .tooltip,
    .popover
  ) {
  font-family: var(--panel-font);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  :is(.page-body-wrapper, .main-panel, .content-wrapper) {
  background: var(--theme-bg) !important;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .content-wrapper {
  padding: 28px var(--panel-gutter) 36px !important;
  min-width: 0;
}

/* A quiet, fixed shell with one clear active navigation state. */
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .navbar {
  border-bottom: 1px solid var(--theme-border-subtle);
  box-shadow: none;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .navbar
  .navbar-brand-wrapper {
  border-right: 1px solid var(--theme-border-subtle);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .navbar
  .navbar-brand.brand-logo {
  margin: 0 !important;
  gap: 9px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.8px;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .navbar
  .navbar-brand
  img {
  height: 29px;
  max-width: 32px;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .navbar
  .navbar-menu-wrapper {
  padding: 0 24px;
  gap: 16px;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .navbar
  .navbar-toggler {
  border-radius: var(--panel-control-radius);
  height: 44px;
  width: 44px;
  padding: 10px;
  flex-shrink: 0;
}
.panel-workspace-label {
  color: var(--theme-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-right: auto;
  white-space: nowrap;
}
.panel-member {
  display: flex;
  align-items: center;
  gap: 9px;
  border-left: 1px solid var(--theme-border-subtle);
  padding-left: 18px;
  margin-left: 18px !important;
}
.panel-member-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--theme-border);
  border-radius: 10px;
  background: var(--theme-raised);
  color: var(--theme-text);
  font-size: 12px;
  font-weight: 800;
}
.panel-member-name {
  color: var(--theme-text);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .theme-toggle {
  border-radius: var(--panel-control-radius);
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
  background: var(--theme-navbar);
  border-color: var(--theme-border);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .sidebar {
  border-right: 1px solid var(--theme-border-subtle);
  background: var(--theme-surface);
}
.panel-sidebar-intro {
  padding: 26px 24px 18px;
}
.panel-section-label {
  display: block;
  color: var(--theme-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.panel-sidebar-intro strong {
  font-size: 12px;
  color: var(--theme-text);
  font-weight: 700;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .sidebar
  > .nav {
  padding: 0 12px 24px;
  margin: 0;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .sidebar
  .nav
  .nav-item {
  padding: 0;
  margin-bottom: 4px;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .sidebar
  .nav
  .nav-link {
  min-height: 43px;
  padding: 11px 12px;
  gap: 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--theme-secondary);
  transition:
    background-color 150ms ease,
    color 150ms ease;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .sidebar
  .nav
  .nav-link
  .menu-title {
  font-size: 12px;
  font-weight: 600;
  color: inherit;
  line-height: 1.45;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .sidebar
  .nav
  .nav-link
  .menu-icon {
  margin: 0;
  width: 19px;
  flex-shrink: 0;
  font-size: 17px;
  color: var(--theme-muted);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .sidebar
  .nav
  .nav-link:hover {
  background: var(--theme-raised);
  color: var(--theme-text);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .sidebar
  .nav
  :is(.nav-item.active > .nav-link, .nav-link.active) {
  background: var(--theme-active);
  color: var(--theme-link);
  box-shadow: inset 3px 0 0 var(--theme-primary);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .sidebar
  .nav
  .nav-link.active
  .menu-icon {
  color: var(--theme-link);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .sidebar
  .nav
  :is(.collapse, .sub-menu) {
  background: transparent;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .sidebar
  .nav
  .sub-menu {
  padding: 6px 0 2px 25px;
  margin: 0 0 0 11px;
  border-left: 1px solid var(--theme-border);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .sidebar
  .nav
  .sub-menu
  .nav-item::before {
  display: none;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .sidebar
  .nav
  .sub-menu
  .nav-link {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 12px;
  white-space: normal;
}
.panel-publisher-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 14px;
  padding: 13px 10px;
  border: 1px solid var(--theme-border-subtle);
  border-radius: 12px;
  background: var(--theme-raised);
  text-decoration: none;
}
.panel-publisher-identity {
  display: grid;
  min-width: 0;
  gap: 4px;
}
.panel-publisher-identity strong {
  font-size: 12px;
  color: var(--theme-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel-publisher-identity > span {
  font-size: 10px;
  color: var(--theme-muted);
}
.panel-publisher-profile > i {
  font-size: 11px;
  margin-left: auto;
  color: var(--theme-muted);
}
.panel-publisher-profile:hover {
  border-color: var(--theme-primary);
  text-decoration: none;
}

/* Consistent hierarchy across existing Bootstrap and page-specific components. */
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  :is(
    .topbar-title,
    .page-title,
    .content-wrapper > .row:first-child h3.font-weight-bold
  ) {
  color: var(--theme-text);
  font-weight: 800;
  font-size: clamp(24px, 2.1vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.8px;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  :is(.topbar-subtitle, .section-subtitle, .card-description) {
  color: var(--theme-muted);
  font-size: 13px;
  line-height: 1.65;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  :is(.card-title, .section-title, .suite-section-title) {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.2px;
  text-transform: none;
  color: var(--theme-text);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  :is(
    .card,
    .premium-card,
    .suite-card,
    .crm-card,
    .filter-card,
    .outreach-card,
    .am-card,
    .ag-card-glass
  ) {
  border: 1px solid var(--theme-border-subtle);
  border-radius: var(--panel-radius);
  background: var(--theme-surface);
  box-shadow: var(--panel-card-shadow);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  :is(.card .card-body, .premium-card) {
  padding: 24px;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  :is(.card-header, .modal-header) {
  padding: 18px 24px;
  background: var(--theme-surface);
  border-bottom-color: var(--theme-border-subtle);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .modal-content {
  border: 1px solid var(--theme-border);
  border-radius: 18px;
  box-shadow: var(--panel-elevation);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  :is(.modal-body, .modal-footer) {
  padding: 20px 24px;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .modal-footer {
  border-top-color: var(--theme-border-subtle);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  :is(.dropdown-menu, .swal-modal) {
  border-radius: 12px;
  border: 1px solid var(--theme-border);
  box-shadow: var(--panel-elevation);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .btn {
  border-radius: var(--panel-control-radius);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  padding: 10px 16px;
  min-height: 40px;
  box-shadow: none;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .btn-sm {
  font-size: 12px;
  min-height: 34px;
  padding: 7px 11px;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .btn-group
  > .btn:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .btn-group
  > .btn:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  :is(.btn-primary, .btn-premium-primary) {
  background: var(--theme-primary);
  border-color: var(--theme-primary);
  color: var(--theme-on-primary);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  :is(.btn-primary, .btn-premium-primary):hover {
  background: var(--theme-primary-hover);
  border-color: var(--theme-primary-hover);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  :is(.btn-secondary, .btn-light, .btn-outline-secondary) {
  background: var(--theme-surface);
  border-color: var(--theme-border);
  color: var(--theme-secondary);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  :is(.btn-secondary, .btn-light, .btn-outline-secondary):hover {
  background: var(--theme-raised);
  border-color: var(--theme-control-border);
  color: var(--theme-text);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  :is(
    .form-control,
    .custom-select,
    .dashboard-date-input,
    .dashboard-date-select
  ) {
  border-radius: var(--panel-control-radius);
  min-height: 42px;
  font-size: 13px;
  background: var(--theme-input);
  color: var(--theme-text);
  border-color: var(--theme-control-border);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  :is(
    .form-control,
    .custom-select,
    .dashboard-date-input,
    .dashboard-date-select
  ):focus {
  border-color: var(--theme-focus);
  box-shadow: var(--theme-focus-ring);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .form-group
  > label {
  font-size: 12px;
  font-weight: 700;
  color: var(--theme-secondary);
  margin-bottom: 8px;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .input-group-text {
  border-radius: var(--panel-control-radius);
  background: var(--theme-raised);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .table {
  font-size: 13px;
  color: var(--theme-text);
  font-variant-numeric: tabular-nums;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .table
  thead
  th {
  background: var(--theme-raised);
  color: var(--theme-secondary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.35px;
  padding: 15px 16px;
  border-color: var(--theme-border);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .table
  tbody
  td {
  padding: 16px;
  border-color: var(--theme-border-subtle);
  line-height: 1.6;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .table-hover
  tbody
  tr:hover {
  background: var(--theme-hover);
  color: var(--theme-text);
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .badge {
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 9px;
  line-height: 1.3;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .page-link {
  border-radius: 7px;
  margin: 0 2px;
  min-width: 34px;
  min-height: 34px;
  text-align: center;
  font-weight: 600;
}
html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
  .footer {
  background: var(--theme-bg);
  border-top: 1px solid var(--theme-border-subtle);
  padding: 20px var(--panel-gutter);
  font-size: 11px;
  color: var(--theme-muted);
}

/* Dashboard composition: room for the figures, with consistent supporting controls. */
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .topbar-header {
  margin-bottom: 24px;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .dashboard-eyebrow {
  display: block;
  background: transparent;
  color: var(--theme-muted);
  padding: 0;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .crm-command-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 24px;
  border: 1px solid var(--theme-border-subtle);
  border-radius: 12px;
  background: var(--theme-surface);
  box-shadow: none;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .dashboard-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .dashboard-filter-label {
  margin: 0 4px 0 0;
  color: var(--theme-muted);
  font-size: 11px;
  font-weight: 700;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .dashboard-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .btn-premium {
  min-height: 40px;
  border-radius: var(--panel-control-radius);
  border: 1px solid var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-secondary);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
  transform: none;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .btn-premium:hover {
  border-color: var(--theme-primary);
  color: var(--theme-link);
  background: var(--theme-hover);
  transform: none;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .btn-premium.btn-premium-primary {
  background: var(--theme-primary);
  border-color: var(--theme-primary);
  color: var(--theme-on-primary);
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .btn-premium.btn-premium-primary:hover {
  background: var(--theme-primary-hover);
  color: var(--theme-on-primary);
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .crm-shell {
  gap: 20px;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .kpi-grid-extended {
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .kpi-card {
  background: var(--theme-surface);
  border: 1px solid var(--theme-border-subtle);
  border-radius: 14px;
  box-shadow: var(--panel-card-shadow);
  padding: 20px;
  min-height: 144px;
  transform: none;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .kpi-card:hover {
  background: var(--theme-surface);
  border-color: var(--theme-border);
  transform: none;
  box-shadow: var(--panel-card-shadow);
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .kpi-top {
  gap: 9px;
  margin-bottom: 13px;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .kpi-title {
  color: var(--theme-secondary);
  font-size: 11px;
  font-weight: 700;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .kpi-icon {
  background: var(--theme-raised) !important;
  color: var(--theme-link) !important;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  font-size: 15px;
  box-shadow: none;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .kpi-value {
  font-size: clamp(25px, 2.2vw, 32px);
  line-height: 1.2;
  color: var(--theme-text);
  font-weight: 800;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .kpi-meta {
  margin-top: 7px;
  font-size: 10px;
  color: var(--theme-muted);
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .summary-strip {
  padding: 0;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .summary-cell {
  padding: 18px 22px;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .summary-metrics
  strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .quick-action-item {
  background: var(--theme-surface);
  border: 1px solid var(--theme-border-subtle);
  border-radius: 10px;
  box-shadow: none;
  transform: none;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .quick-action-item:hover {
  background: var(--theme-hover);
  border-color: var(--theme-border);
  transform: none;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .quick-action-icon {
  border-radius: 8px;
  background: var(--theme-raised);
  color: var(--theme-link);
}

@media (min-width: 992px) {
  html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
    .sidebar-icon-only
    :is(.panel-sidebar-intro, .panel-publisher-profile) {
    display: none;
  }
  html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
    .sidebar-icon-only
    .sidebar
    > .nav {
    padding: 20px 12px;
  }
  html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
    .sidebar-icon-only
    .sidebar
    .nav
    > .nav-item
    > .nav-link {
    justify-content: center;
    padding: 12px;
  }
  html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
    .sidebar-icon-only
    .sidebar
    .nav
    > .nav-item.hover-open
    > .nav-link
    .menu-title {
    color: var(--theme-text);
    background: var(--theme-surface);
  }
}
@media (max-width: 1100px) {
  .panel-member-name {
    display: none;
  }
  html[data-theme]:is(
      [data-theme-page="admin-dashboard"],
      [data-theme-page="public-dashboard"]
    )
    .kpi-card {
    padding: 16px;
  }
}
@media (max-width: 991px) {
  .panel-workspace-label {
    display: none;
  }
  .panel-member {
    margin-left: 12px !important;
    padding-left: 12px;
  }
  html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
    .navbar
    .navbar-menu-wrapper {
    padding: 0 14px;
    gap: 10px;
  }
  html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
    .sidebar
    .nav
    .nav-link {
    min-height: 44px;
  }
  html[data-theme]:is(
      [data-theme-page="admin-dashboard"],
      [data-theme-page="public-dashboard"]
    )
    .kpi-grid-extended {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 575px) {
  html:is([data-theme-page^="admin-"], [data-theme-page^="public-"]) {
    --panel-gutter: 16px;
  }
  html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
    .content-wrapper {
    padding-top: 24px !important;
  }
  html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
    :is(.card .card-body, .premium-card) {
    padding: 18px;
  }
  html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
    .btn {
    min-height: 44px;
  }
  html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
    .btn-sm {
    padding: 8px 10px;
  }
  html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
    :is(
      input.form-control,
      select.form-control,
      .custom-select,
      .dashboard-date-input,
      .dashboard-date-select
    ) {
    min-height: 44px;
    font-size: 16px;
  }
  html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
    .table
    thead
    th {
    padding: 12px;
  }
  html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
    .table
    tbody
    td {
    padding: 12px;
  }
  html[data-theme]:is(
      [data-theme-page="admin-dashboard"],
      [data-theme-page="public-dashboard"]
    )
    .kpi-grid-extended {
    gap: 12px;
  }
  html[data-theme]:is(
      [data-theme-page="admin-dashboard"],
      [data-theme-page="public-dashboard"]
    )
    .kpi-card {
    min-height: 134px;
    padding: 16px;
  }
  html[data-theme]:is(
      [data-theme-page="admin-dashboard"],
      [data-theme-page="public-dashboard"]
    )
    .crm-command-bar {
    padding: 14px;
  }
  html[data-theme]:is(
      [data-theme-page="admin-dashboard"],
      [data-theme-page="public-dashboard"]
    )
    .dashboard-toolbar-actions {
    width: 100%;
  }
  html[data-theme]:is(
      [data-theme-page="admin-dashboard"],
      [data-theme-page="public-dashboard"]
    )
    .dashboard-toolbar-actions
    .btn-premium {
    flex: 1;
    min-height: 44px;
  }
  html[data-theme]:is(
      [data-theme-page="admin-dashboard"],
      [data-theme-page="public-dashboard"]
    )
    .summary-strip {
    padding: 0;
  }
  html[data-theme]:is(
      [data-theme-page="admin-dashboard"],
      [data-theme-page="public-dashboard"]
    )
    .dashboard-custom-range {
    flex-wrap: wrap;
  }
  html[data-theme]:is(
      [data-theme-page="admin-dashboard"],
      [data-theme-page="public-dashboard"]
    )
    .dashboard-custom-range
    input {
    min-width: 0;
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
    :is(
      .sidebar .nav .nav-link,
      .btn,
      .premium-card,
      .kpi-card,
      .quick-action-item
    ) {
    transition: none;
  }
}
@media print {
  .panel-member,
  .panel-workspace-label,
  .panel-sidebar-intro {
    display: none !important;
  }
  html[data-theme]:is([data-theme-page^="admin-"], [data-theme-page^="public-"])
    :is(.card, .premium-card, .kpi-card) {
    box-shadow: none;
  }
}

/* Remove the old decorative dashboard glow and keep the summary compact. */
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .kpi-card::before,
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .kpi-card::after {
  display: none;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .summary-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 12px;
}
html[data-theme]:is(
    [data-theme-page="admin-dashboard"],
    [data-theme-page="public-dashboard"]
  )
  .btn-premium.btn-premium-primary
  i {
  color: inherit;
}

/* Dark-only surface and type roles. Preserve every existing layout and state. */
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  .sidebar
  .nav
  .nav-item.active {
  background: transparent;
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    .topbar-title,
    .page-title,
    .section-title,
    .card-title,
    .modal-title,
    .swal-title,
    .kpi-value,
    .stat-value,
    .detail-value,
    .details-value,
    .summary-metrics strong,
    .kpi-card strong,
    .panel-member-name,
    .panel-publisher-identity strong
  ):not([data-theme-preserve] *) {
  color: var(--text-primary);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(
    .kpi-title,
    .stat-label,
    .detail-label,
    .details-label,
    .empty-state,
    .panel-section-label,
    .dashboard-filter-label
  ) {
  color: var(--text-muted);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(.kpi-meta, .panel-workspace-label, .panel-publisher-identity > span) {
  color: var(--text-subtle);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  .sidebar {
  background: var(--bg-secondary);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  .sidebar
  .nav
  .nav-link {
  color: var(--text-muted);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  .sidebar
  .nav
  .nav-link:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  .sidebar
  .nav
  :is(.nav-item.active > .nav-link, .nav-link.active) {
  background: var(--accent-soft);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  .sidebar
  .nav
  :is(.nav-item.active > .nav-link, .nav-link.active, .nav-link:hover)
  .menu-icon {
  color: var(--accent-text);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(.panel-publisher-profile, .panel-member-avatar) {
  background: var(--surface-1);
  border-color: var(--border-subtle);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  .publisher-sidebar-profile-link.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  .navbar
  .navbar-brand {
  color: var(--text-primary) !important;
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  .theme-toggle:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(.kpi-icon, .quick-action-icon) {
  background: var(--accent-soft) !important;
  color: var(--accent-text) !important;
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(.dashboard-toolbar, .crm-command-bar, .filter-panel) {
  background: var(--surface-1);
  border-color: var(--border-subtle);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  .dashboard-toolbar
  :is(.dashboard-date-select, .dashboard-date-input) {
  background: var(--surface-input);
  border-color: var(--border-control);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(.modal-content, .swal-modal) {
  background: var(--theme-modal);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(
    .modal-header,
    .modal-footer,
    .swal-footer,
    .popover-header,
    .popover-body
  ) {
  background: var(--surface-2);
  border-color: var(--border-subtle);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(
    .dropdown-menu,
    .popover,
    .filter-list,
    .filter-picker-menu,
    .campaign-picker-menu,
    .offer-picker-menu,
    .publisher-suggestions,
    .choices__list--dropdown,
    .choices__list[aria-expanded],
    .select2-dropdown,
    .datepicker-dropdown,
    .toast-notification
  ) {
  background: var(--theme-dropdown);
  border-color: var(--border-subtle);
  box-shadow: var(--panel-elevation);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  .popover
  .arrow::after {
  border-top-color: var(--surface-2);
  border-bottom-color: var(--surface-2);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(.swal-content__input, .swal-content__textarea) {
  background: var(--surface-input);
  border-color: var(--border-control);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  .swal-modal
  :is(.swal-icon--success)::before,
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  .swal-modal
  .swal-icon--success::after,
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  .swal-icon--success__hide-corners {
  background: var(--surface-2);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(
    .btn-primary,
    .btn-premium.btn-premium-primary,
    .swal-button--confirm:not(.swal-button--danger)
  ):not(:disabled):not(.disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-primary);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(
    .btn-primary,
    .btn-premium.btn-premium-primary,
    .swal-button--confirm:not(.swal-button--danger)
  ):hover:not(:disabled):not(.disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(
    .btn-primary,
    .btn-premium.btn-premium-primary,
    .swal-button--confirm:not(.swal-button--danger)
  ):is(:active, .active):not(:disabled):not(.disabled) {
  background: var(--accent-pressed);
  border-color: var(--accent-pressed);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(
    .btn,
    .btn-premium,
    .theme-toggle,
    .swal-button,
    .page-link
  ):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: var(--theme-focus-ring);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(
    .form-control,
    .custom-select,
    .dashboard-date-select,
    .dashboard-date-input
  ):focus {
  border-color: var(--accent);
  box-shadow: var(--theme-focus-ring);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(.btn-outline-primary, .filter-chip) {
  border-color: var(--accent-border);
  color: var(--accent-text);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(.btn-outline-primary, .filter-chip):hover {
  background: var(--accent-soft);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  input:is([type="checkbox"], [type="radio"]) {
  accent-color: var(--accent);
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(.pagination .page-item.active .page-link, .nav-tabs .nav-link.active) {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text-primary);
}
/* Legacy color utilities on modal headings and financial summary cards. */
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(.modal-header, .card-header):is(.bg-primary, .bg-success, .bg-info) {
  background: var(--surface-2) !important;
}
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(.modal-header, .card-header)
  .text-white,
html[data-theme="dark"]:is(
    [data-theme-page^="admin-"],
    [data-theme-page^="public-"]
  )
  :is(.modal-header.text-white, .card-header.text-white) {
  color: var(--text-primary) !important;
}
html[data-theme="dark"][data-theme-page="public-offerStats"]
  .card[style*="linear-gradient"] {
  background: var(--surface-1) !important;
  color: var(--text-secondary) !important;
  box-shadow: var(--panel-card-shadow) !important;
}
html[data-theme="dark"][data-theme-page="public-profile"] .profile-page {
  background: var(--bg-primary);
}

.panel-nav-new { margin-left: auto; padding: 2px 6px; border: 1px solid var(--theme-primary); border-radius: 5px; color: var(--theme-link); background: var(--theme-active); font-size: 10px; font-weight: 700; line-height: 1.5; }
.sidebar-icon-only .panel-nav-new { display: none; }
