/* CIVADELIA_DASHBOARD_BRANDING_HIGHLIGHTS_V1
   Tenant primary colour drives workspace highlights, including the My Modules
   action (the former product-red variables now resolve to the brand tokens). */

body.co-ui-v1 .co-tenant-shell {
  --civadelia-product-red: var(--brand);
  --civadelia-product-red-hover: var(--brand-hover);
  --civadelia-product-red-soft: var(--brand-soft);

  /* Bridge the GS01 institution colour into older workspace components
     that still consume --co-primary instead of --co-tenant-primary. */
  --co-primary: var(--brand);
  --co-primary-hover: var(--brand-hover);
  --co-primary-strong: var(--brand-strong);
  --co-primary-soft: var(--brand-soft);
}

/* Sidebar: the selected destination is institution-branded. */
body.co-ui-v1 .co-tenant-shell .co-side-nav a.is-active {
  background: color-mix(in srgb, var(--brand) 34%, transparent) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 0 var(--brand) !important;
}
body.co-ui-v1 .co-tenant-shell .co-side-nav a.is-active .co-icon {
  color: color-mix(in srgb, var(--brand) 48%, #fff 52%) !important;
}
body.co-ui-v1 .co-tenant-shell .co-side-nav a:hover .co-icon {
  color: color-mix(in srgb, var(--brand) 42%, #fff 58%) !important;
}

/* Dashboard: visible highlights follow the GS01 institution Primary colour. */
body.co-ui-v1 .civ-workspace-v3 .co-page-kicker {
  color: var(--brand-text) !important;
}
body.co-ui-v1 .civ-workspace-v3 .co-panel-head > a {
  color: var(--brand-text) !important;
}
body.co-ui-v1 .civ-workspace-v3 .co-action-tile:hover,
body.co-ui-v1 .civ-workspace-v3 .co-module-grid > a:hover {
  border-color:color-mix(in srgb, var(--brand) 34%, var(--border-subtle) 66%)!important;
}

/* My Modules is a Civadelia product action, not tenant branding. */
body.co-ui-v1 .civ-workspace-v3 .civadelia-my-modules-btn {
  background: var(--civadelia-product-red) !important;
  border-color:var(--civadelia-product-red)!important;
  color: var(--on-brand) !important;
}
body.co-ui-v1 .civ-workspace-v3 .civadelia-my-modules-btn:hover {
  background: var(--civadelia-product-red-hover) !important;
  border-color:var(--civadelia-product-red-hover)!important;
  color: var(--on-brand) !important;
}
body.co-ui-v1 .civ-workspace-v3 .civadelia-my-modules-tile .co-action-icon {
  background: var(--civadelia-product-red-soft) !important;
  color: var(--brand-text) !important;
}

/* CIVADELIA_OPERATIONS_TENANT_BRANDING_V1
   Civadelia Operations configures the selected institution, so its icon tiles
   should follow the institution's GS01 Primary colour instead of product red. */
body.co-ui-v1 .civ-workspace-v3 .civadelia-operations-panel .co-module-grid .co-action-icon {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  display: grid !important;
  place-items: center !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 0 8px 0 !important;
  border:0!important;
  border-radius: 8px !important;
  background: color-mix(in srgb, var(--brand) 10%, #fff 90%) !important;
  color: var(--brand-text) !important;
  line-height: 0 !important;
}
body.co-ui-v1 .civ-workspace-v3 .civadelia-operations-panel .co-module-grid .co-action-icon .co-icon {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
  margin: 0 !important;
  color: inherit !important;
  stroke: currentColor !important;
  flex: none !important;
}

/* CIVADELIA_MY_MODULES_TENANT_BRANDING_V1
   My Modules is part of the active institution workspace, so its dashboard
   icon tile follows the tenant Primary colour just like the other workspace
   highlights. */
body.co-ui-v1 .civ-workspace-v3 .civadelia-my-modules-tile .co-action-icon {
  background: color-mix(
    in srgb,
    var(--brand) 10%,
    #fff 90%
  ) !important;
  color: var(--brand-text) !important;
}

body.co-ui-v1 .civ-workspace-v3 .civadelia-my-modules-tile .co-action-icon .co-icon {
  color: inherit !important;
  stroke: currentColor !important;
}
